Highlighted

Is it possible to manipulate the PDF Bookmarks setup via ExtendScript

New Here ,
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

Adobe Community Professional
Correct answer by frameexpert | Adobe Community Professional

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.

Views

305

Likes

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

Is it possible to manipulate the PDF Bookmarks setup via ExtendScript

New Here ,
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

Adobe Community Professional
Correct answer by frameexpert | Adobe Community Professional

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.

Views

306

Likes

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
Mar 12, 2020 0
Adobe Community Professional ,
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.

Likes

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
Reply
Loading...
Mar 12, 2020 1
AlexDHI LATEST
New Here ,
Mar 13, 2020

Copy link to clipboard

Copied

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

 

Likes

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
Reply
Loading...
Mar 13, 2020 0