With some extremely helpful pointers from Rick Quatro, I believe I have more or less figured out how this has to be done. The script would need to do this: 1. in the FM book, save each file to MIF. 2. add/modify MIF statements in the file. 3. save the file back to the FrameMaker format. For example, I have it figured out for the default PDF zoom level at least. I had to review the mif reference guide (could only find it for FM 8, any later guide out there?) and map that to the mif statements for FM 10 documents. They are similar to FM 8, but also slightly different. There's the following MIF document statements:
- <DPDFFit None>
- <DPDFZoom 125.0%>
In each document in the book, I need to set the above MIF statements. Then, the FM book will print the document to PDF, where the default zoom level is 125%. A big thanks to Rick on this one.
Actually, you may be able to set these properties directly without using MIF. The FrameScript versions are:
Set oBook.PDFZoomType = PDFZoomNone;
Set oBook.PDFZoomFactor = 1.25;
where oBook is your book object. These properties can be set at the document level as well. The ExtendScript equivalents are:
book.PDFZoomType = Constants.FV_PDFZoomNone;
book.PDFZoomFactor = 1.25;
I am not sure if 1.25 will work with ExtendScript. You may have to figure out how to coerce the number into the correct metric value.
As far as saving to MIF, it is the .book file itself that has to be saved to MIF in order to set the correct bookmark levels for the paragraphs in the book. That is what the other thread referred to.
I hope this helps.
I cannot seem update the zoom level no matter what I do. Here's what I tried:
var Book = app.ActiveBook;
$.writeln('zoom factor before: '+ Book.PDFZoomFactor)
$.writeln('zoom factor after: '+ Book.PDFZoomFactor)
According to the extendscript guide:
When the PDFZoomType property is set to Constants.FV_PDFZoomNone (0), the PDFZoomFactor property denotes the zoom percentage of the PDF document (metric 25% to 1600%).
It also says the data type of the property is an integer. Here is the the default value: 81920. I have no idea where this number came from or what it is supposed to represent. When I attempt to set the PDF zoom factor to 125, that returns an error "number out of range". If I use a large number like 90,000, then it does update the property successfully but it doesn't change the default zoom level in the PDF. The PDF zoom level is always set to "Fit Width".
Also, do you have any idea what this opaque statement is supposed to mean: (metric 25% to 1600%). What in the world is a metric of a percentage, which is what that seems to be saying?