Copy link to clipboard
Copied
Hi everybody,
I wrote an application using the FDK that simply opens a book, saves it as pdf (using API call F_ApiSave and FS_FileType=FV_SaveFmtPdf). Everything works like a charme but the page size. The book contains several A4 documents but the final PDF is created using the US Letter format resulting in a too short page.
If I export manually the book (using Framemaker interactively) the resulting PDF contains A4 sized pages.
I already tried to set the Adobe PDF printer default settings via the Control Panel (I set A4 as default page size).
Hopefully someone can point me out to a solution.
Thanks
Copy link to clipboard
Copied
I'd suggest that you set the FP_PDFPageHeight and FP_PDFPageWidth properties for the FO_Book object. See also the other PDF properies listed for books in the FDK Programmer's Reference.
If this doesn't work, try asking again in the Adobe: FrameMaker Scripting forum.
Copy link to clipboard
Copied
Dear Mike,
thanks for your reply. This sounds like a good suggestion but I have no clue how to set FP_PDFPageHeight and FP_PDFPageWidth properties.... I looked at the programmer reference but I can't find them. Any further help?
Copy link to clipboard
Copied
If you search the FDK Programmer's Reference for FP_PDFPageHeight, you'll find the following documentation within the Object Reference chapter, FO_Book section:
Property | Type | Meaning |
---|---|---|
FP_PDFPageHeight | MetricT | Page height for the generated PDF |
FP_PDFPageWidth | MetricT | Page width for the generated PDF |
So these are properties of type MetricT . You must set them using the call F_ApiSetMetric().
#include "fapi.h"
VoidT F_ApiSetMetric(F_ObjHandleT docId, F_ObjHandleT objId, IntT propNum, MetricT setVal);
(RTFM for more details.)
In your case, you need something like the following:
F_ApiSetMetric(FV_SessionId, bookId, FP_PDFPageHeight, 297*FV_METRIC_MM);
F_ApiSetMetric(FV_SessionId, bookId, FP_PDFPageWidth, 210*FV_METRIC_MM);
where bookId is the id of your book, that you later pass as the first parameter of F_ApiSave().
Copy link to clipboard
Copied
Thank you Mike for your kindness, I will try to implement this solution.