Copy link to clipboard
Copied
Has anyone created PDFs from an ExtendScript with FrameMaker 2020 or newer (2022 beta) ? I have tried to use the Doc.Save function with the FileType set to SaveFmtPdf but this freezes FrameMaker - after sending a couple of (for me) incomprehensible messages to the console.
I am not aware of any password protection. When I choose Save as PDF from the File menu, the PDF is created without any issues. If there is another way (using CallClient to the Publish panel ?) I would like to know that, too. I am not stuck on any particular method, as long as I can automate the creation of PDFs.
Thanks in advance for a quick reply - especially if you have a working solution.
Jang
Here is a function I use for one of my clients. It is namespaced, but you can remove it or change it.
WE_PMO.saveBookAsPdf = function (book, name) {
var params, returnParams, i;
params = GetSaveDefaultParams ();
returnParams = new PropVals ();
i = GetPropIndex (params, Constants.FS_FileType);
params[i].propVal.ival = Constants.FV_SaveFmtPdf;
i = GetPropIndex (params, Constants.FS_PDFUseDistiller);
params[i].propVal.ival = 0;
FA_errno = 0;
book.Sa
...
Copy link to clipboard
Copied
Jang, please post your code and I will take a look. Thanks.
Copy link to clipboard
Copied
Here is a function I use for one of my clients. It is namespaced, but you can remove it or change it.
WE_PMO.saveBookAsPdf = function (book, name) {
var params, returnParams, i;
params = GetSaveDefaultParams ();
returnParams = new PropVals ();
i = GetPropIndex (params, Constants.FS_FileType);
params[i].propVal.ival = Constants.FV_SaveFmtPdf;
i = GetPropIndex (params, Constants.FS_PDFUseDistiller);
params[i].propVal.ival = 0;
FA_errno = 0;
book.Save (name, params, returnParams);
if (FA_errno !== 0) {
PrintSaveStatus (returnParams);
}
return FA_errno;
};
Copy link to clipboard
Copied
Thanks, Rick.
I missed the FS_PDFUseDistiller parameter (as the Save as PDF no longer uses that route) and had an error in the declaration of the return parameters array. After fixing those two issues it is working as intended. Now the only issue to solve is how to get to PDF/A-2a. It looks like I will have to do some Adobe Acrobat Pro scripting to automate that part of the workflow.
Kind regards
Jang