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

Is it possible to manipulate the PDF Bookmarks setup via ExtendScript

New Here ,
Mar 12, 2020 Mar 12, 2020

Copy link to clipboard

Copied

Hi,

I am using Adobe FrameMaker 12 unstructured.

I have an ExtendScript that updates the book with regards to numbers and handles some conditional contents. And as a last step it saves the document as a PDF file.

In the FrameMaker 12 application when you select the menu item File|Save As PDF you get the PDF Setup for Selected Files dialogue. In the Bookmarks tab section, you can manipulate which Paragraphs you want to include in PDF generation.

Is it possible to manipulate this PDF Bookmarks setup via ExtendScript ?

And if so you have any code snippets i can get inspired by?

Thank you for the help

Views

485

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

correct answers 1 Correct answer

Community Expert , Mar 12, 2020 Mar 12, 2020

The bookmarks setup is actually a property of each PgfFmt (paragraph format) in the document. The property is called AcrobatLevel and it is an integer determining the bookmark level for paragraphs of the paragraph format. If it is set to 0, the paragraphs for that format are not included as bookmarks.

 

Note that for a book, I think the critical document for setting these would be the first component in the book. So make sure that the first component in the book contains all of your relevant parag

...

Votes

Translate

Translate
Community Expert ,
Mar 12, 2020 Mar 12, 2020

Copy link to clipboard

Copied

The bookmarks setup is actually a property of each PgfFmt (paragraph format) in the document. The property is called AcrobatLevel and it is an integer determining the bookmark level for paragraphs of the paragraph format. If it is set to 0, the paragraphs for that format are not included as bookmarks.

 

Note that for a book, I think the critical document for setting these would be the first component in the book. So make sure that the first component in the book contains all of your relevant paragraph formats, even if you are not using them in the first component.

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 ,
Mar 13, 2020 Mar 13, 2020

Copy link to clipboard

Copied

LATEST

Thank you for your reply @frameexpert,

 

With your explanation and with the help of Save PDF with Bookmarks i got it to work as I wanted.

We have a CHP paragraf format that is not included in the PDF Bookmarks by default when we create PDF document. I now ensure that in a functions that closes all open files in the script.

Function is here to inspire others

function CloseAll()
{
    doc=app.FirstOpenDoc
    while(doc.id !=0)
    {
        var params = GetSaveDefaultParams();
        var returnParamsp = new PropVals();

        doc2=doc.NextOpenDocInSession;
        
        // Ensure CHP is included in the PDF Bookmarks
        var pgfFmt = doc.GetNamedPgfFmt ("CHP");
        if(pgfFmt.ObjectValid() == true) {
           pgfFmt.AcrobatLevel = 1;
           doc.PDFBookmark = true;
        } else {
            FmLogFile.writeln("Could not get CHP format");
        }
        
        doc.Save( doc.Name, params, returnParamsp);
        doc.Close(Constants.FF_CLOSE_MODIFIED);
        doc = doc2;   
   }

    book=app.FirstOpenBook
    while(book.id !=0)
    {
        var params = GetSaveDefaultParams();
        var returnParamsp = new PropVals();

        book2=book.NextOpenBookInSession;
        book.Save( book.Name, params, returnParamsp);
        book.Close(Constants.FF_CLOSE_MODIFIED);
        book=book2
    }
}

 

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