Copy link to clipboard
Copied
I'm running publishing process to PDF for a DITA Map by script (FDK client) in FrameMaker 2022. I'm going the book way, as I need TOC and a title page!
When running pulishing by double clicking PDF icon in publishing dialog all works well and bookmarks are correct in PDF!
When running publishing process via CallClient, PDF bookmark settings are not updated in book, and therefore all elements are creating a bookmark not the one that are defined in templates...
I tried to catch event FA_Note_PostOpenBook to update PDF settings in Book programmatically after book is opened. But this event is not fired.
Any idea how I can fix this? Is there a book template in installation where I can change defaults? Anything which helps me doing this programmatically would help me.
Thanks in advance
Markus
Hi Markus,
I have had similar issues for some clients. I found that I have to programmatically set the bookmark levels throughout all of the components in the book before it gets saved to PDF. I use a simple XML file to determine the levels:
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<bookmarkLevels>
<format name="ctoc.appendix.number" level="1"/>
<format name="ctoc.chapter.number" level="1"/>
<format name="title.0" level="2"/>
<format name="title.0.fro
...
I am using this notification:
Notification (Constants.FA_Note_PostPublishDitamap, true);
because I am publishing a ditamap.
Copy link to clipboard
Copied
Hi Markus,
I have had similar issues for some clients. I found that I have to programmatically set the bookmark levels throughout all of the components in the book before it gets saved to PDF. I use a simple XML file to determine the levels:
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<bookmarkLevels>
<format name="ctoc.appendix.number" level="1"/>
<format name="ctoc.chapter.number" level="1"/>
<format name="title.0" level="2"/>
<format name="title.0.frontmatter" level="2"/>
<format name="title.1" level="3"/>
<format name="title.2" level="4"/>
<format name="title.3" level="5"/>
<format name="title.4" level="6"/>
<format name="title.a" level="2"/>
</bookmarkLevels>
</settings>
Then I have a function that sets the bookmark levels on each paragraph format in each document:
AA_SBL.processDoc = function (doc, xml) {
var pgffmt, level;
if (app.Displaying == 1) {
app.Displaying = 0;
}
pgffmt = doc.FirstPgfFmtInDoc;
while (pgffmt.ObjectValid () === 1) {
level = String (xml.format.(@name == pgffmt.Name).@level);
if (level !== "") {
pgffmt.AcrobatLevel = Number (level);
}
else {
pgffmt.AcrobatLevel = 0;
}
pgffmt = pgffmt.NextPgfFmtInDoc;
}
if (app.Displaying == 0) {
app.Displaying = 1;
doc.Redisplay();
}
};
Copy link to clipboard
Copied
@frameexpert thank you for confirming this issue and the sample... What is the trigger you use? As this FM Book is generated temporarily in PDF generation process I hoped I could use Notify event when book is opened in FM, but my FDK client didn't get this event....
Copy link to clipboard
Copied
I am using this notification:
Notification (Constants.FA_Note_PostPublishDitamap, true);
because I am publishing a ditamap.
Copy link to clipboard
Copied
This is what I didn't expected - publishing is finished when PDF is done 🙂 Hahaha
And I need to write a script which does this job, as this event is not send back to calling FDK client.
thanks @frameexpert for your support
Copy link to clipboard
Copied
@frameexpert this works with paragraph bookmarks, very well. any idea on how to do this with element level bookmarks "title(Level1)"? Seems the issue is title and toc page which has no structured content?
Copy link to clipboard
Copied
I haven't encountered this situation Markus so I am not sure. Can you import element definitions into your unstructured title page without messing up it's formatting?
Copy link to clipboard
Copied
How do you set element bookmarks programmatically?
Copy link to clipboard
Copied
that's good question and so annoying...
Tried to import PDF Settings from last document in book to book itself... when catching event PreSaveBook...
No changes so far... I have the settings set in title page, EDD is in but of course no root... will try to add a dita element
Thanks so far Rick.
Copy link to clipboard
Copied
doing this by hand within the book itself, does the job, but not in this publishing scenario... let's see. there will be a way 🙂
Copy link to clipboard
Copied
I have been looking around the FDK docs, but can't see any properties for setting this.
Copy link to clipboard
Copied
Can you post a screenshot of how you are setting the bookmarks in the interface? Thanks.
Copy link to clipboard
Copied
That's the way it works programmatically (outside of publishing)
doc.doc.DocAcrobatElements=1;
this.book.DocAcrobatElements=1;
this.book.DocAcrobatElementList = doc.doc.DocAcrobatElementList;
Otherwise here in UI
Copy link to clipboard
Copied
OK. this is really strange... when I save the book after PostPublishDitaMap Event and call publish Book Bookmarks are right, but not in this DITAMap publishing process