Skip to main content
Participating Frequently
Mar 16, 2018 12:24 PM UTC
Question

Convert fm to pdf

How to convert framemaker doc into pdf using extendcript.?

This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

frameexpert
Community Expert
Community Expert
Mar 16, 2018 12:45 PM UTC

Here is a simple function that you can use, where "doc" is a valid document object.

saveDocToPdf (doc, "High Quality Print");

function saveDocToPdf (doc, jobOption) {  

  

    var params, returnParams, saveName, i;

  

    // Set the PDF Job Option for the document.

    doc.PDFJobOption = jobOption;

    // Replace the .fm extension with .pdf.

    saveName = doc.Name.replace (/\.fm$/i, ".pdf");

    // Get the save parameters and set the file type to PDF>

    params = GetSaveDefaultParams();

    returnParams = new PropVals();

    i = GetPropIndex (params, Constants.FS_FileType);

    params.propVal.ival =Constants.FV_SaveFmtPdf;

    // Call the document's Save method.

    doc.Save (saveName, params, returnParams);

}

Translate
www.frameexpert.com
Participating Frequently
Mar 19, 2018 10:26 AM UTC

Need to remove unwanted double spaces and paragraph marks in framemaker document using extendscript ?

Translate
Jeff_Coatsworth
Community Expert
Community Expert
Mar 16, 2018 12:28 PM UTC

[Moderator]: Moved to Scripting forum.

Translate