Skip to main content
marinocm
Participant
April 19, 2024
Question

Create Print PDF using ExtendScript

Hi all,

I'm trying to use a script to save all files in a book as single PDF files, but for some reason the value for Constants.FP_PDFSeparateFiles pops up an error; no matter if I try to set it as integer or boolean –

can anyone help?

 

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;
    i = GetPropIndex (params, Constants.FP_PDFSeparateFiles);
    params[i].propVal.ival = true; //1

 

    4 replies

    frameexpert
    Community Expert
    Community Expert
    April 19, 2024

    Also, what is the error you are getting?

    Translate
    www.frameexpert.com
    marinocm
    marinocmAuthor
    Participant
    April 19, 2024

    Hi! I'm working with FM 16 and the error in debugger (vcode) reads:

    Exception has occurred: 21 undefined is not an object
    Translate
    frameexpert
    Community Expert
    Community Expert
    April 19, 2024

    What is line 21 in the code?

     

    I would try it within FrameMaker with File > Script > Run. It may be an issue with the setup in VS-Code.

    Translate
    www.frameexpert.com
    frameexpert
    Community Expert
    Community Expert
    April 19, 2024

    What version of FrameMaker?

    Translate
    www.frameexpert.com