• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Save as PDF: Adobe Distiller vs Framemaker Save As PDF

New Here ,
May 14, 2019 May 14, 2019

Copy link to clipboard

Copied

This is my Framemaker book to PDF saving function:

function saveToPDF(fileObject, savePath) { 

   

    var saveParams, i;

   

    saveParams= GetSaveDefaultParams(); 

   

    i = GetPropIndex(saveParams, Constants.FS_FileType); 

    saveParams.propVal.ival = Constants.FV_SaveFmtPdf;

   

    var saveAsName = savePath; 

    var returnParamsp = new PropVals(); 

    fileObject.Save(saveAsName, saveParams, returnParamsp);

   

}

When I execute this function Framemaker opens the Adobe PDF Distiller which then creates the PDF.

However if I am doing this process manually I open the book go to the File menu and select "Save as PDF".  Using this method Framemaker does not launch the Distiller, it creates the pdf without using any external application.  This generates PDFs much faster.

Is there any way to access the second method of PDF generation using the ESTK?

TOPICS
Scripting

Views

1.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 14, 2019 May 14, 2019

Copy link to clipboard

Copied

Try adding this:

i = GetPropIndex (saveParams, Constants.FS_PDFUseDistiller);

saveParams.propVal.ival = 0;

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 15, 2019 May 15, 2019

Copy link to clipboard

Copied

That save parameter does make it so that the distiller is not visible, but it uses the same process so the distiller is probably just running in the background.

Also I could not find any documentation on this save parameter in the scripting guide.  Latest version I can find is 2017.

I have 2 problems with the script driven pdf generation.

One is that when my PDF function is complete it leaves one of the book components open.  For some reason I cannot access this component using app.ActiveDoc in order to get rid of it.

The second problem is that when PDFing some books, this function will cause Framemaker to crash with Internal Error 15014.  These books always crash when using the script and never crash when manually PDFing from the file menu.

Is there maybe an FCode way to trigger the file menu "Save As PDF"?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 15, 2019 May 15, 2019

Copy link to clipboard

Copied

Also what is the FM Publisher you reference in this thread?

Re: How can i use the FS_PDFUseDistiller porperty ? And how can i set the STS file?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 15, 2019 May 15, 2019

Copy link to clipboard

Copied

That refers to using ExtendScript (or the FDK) to access the File > Publish command. One of the parameters listed specifies the sts file.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 15, 2019 May 15, 2019

Copy link to clipboard

Copied

This is the solution.

using:

    CallClient ("FMPublisher", "SetOutputLocation " + savePath); 

    CallClient ("FMPublisher", "MCPPublish PDF");

Accomplishes the same thing a the file menu "Save As PDF", which is just a shortcut to using the publisher menu and selecting PDF output with the default .sts file.

No more crashes and no more rogue book components.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 15, 2019 May 15, 2019

Copy link to clipboard

Copied

And you can add this to set a specific sts file:

CallClient ("FMPublisher", "SetMCPSetting yourstsfile.sts");

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 15, 2019 May 15, 2019

Copy link to clipboard

Copied

Is there a way to call the publisher on a specific file rather other than the active book?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 15, 2019 May 15, 2019

Copy link to clipboard

Copied

LATEST

I think it only works on the active document or book, so you would have to open the document and make sure it is active (in front) when you invoke the CallClient method calls.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines