Skip to main content
marinocm
Participant
April 19, 2024
Question

Create Print PDF using ExtendScript

  • April 19, 2024
  • 2 replies
  • 310 views

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

 

    2 replies

    frameexpert
    Community Expert
    Community Expert
    April 19, 2024

    Also, what is the error you are getting?

    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
    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.

    frameexpert
    Community Expert
    Community Expert
    April 19, 2024

    What version of FrameMaker?