Jump to content

TOC and Bookmarks conflict with Keep with next paragraph


Recommended Posts

Hi All,


The "Keep with next paragraph" setting seems to be conflicting with my linked table of contents and PDF bookmarks. Hoping someone may have some insight as to what is causing the issue.


I'm trying to create a PDF document with a linked table of contents and bookmarks. I'm using pretty much the same code that step provided in thread 4351, which has worked well in the past, so off to a good start.


The body of the FusionPro template contains section titles, followed by a blank line, followed by a section subtitle, followed by a sentence or paragraph. I'd like to keep the title, blank line, subtitle, and first paragraph following the subtitle together.


The issue occurs when the kept together title-blank-subtitle-firstpara block falls on a page break. In the composed output it looks fine, and is pushed to the next page and kept together. But the page numbers and links in the table of contents are off, they point to the preceding page. And two bookmarks for that section are added, one that points to the incorrect preceding page, and one that points to the correct page.


Turning the Keep with next paragraph setting Off resolves the issue with TOC and Bookmarks, but then the title-blank-subtitle-firstpara block falls apart on page breaks.


I've attached a collected sample job that illustrates the issue well, and two composed PDF output files, one with Keep with next paragraph (KWNP) On, the other with KWNP Off, so you can see what happens to the bookmarks and table of contents. The sample job is static, but the real job is variable length, so I cannot simply adjust the spacing to not fall on a page break.


Thank you in advance for any help!




Link to comment
Share on other sites

Set each of your "TOC Title #" rules to "Re-evaluate this rule for every text flow"


Step, thank you for the suggestion. I tried it just now. However, the issue persists. Did it work on your setup?


I am going to try placing the title-blank-subtitle-firstpara block inside a single table cell to see if that fixes it, and will report back.

Link to comment
Share on other sites

Yes it worked for me. Sample attached.


Unfortunately for me, this could be a Windows version bug. Noticed you are running on a Mac. I see the sample output you provided, and it is perfect. However, running the template you provided, my resulting PDF still has issues. I only replaced the Helvetica Neue font with Arial, and changed the output file destination. The PDF I composed from your template had the same TOC issue, plus for some unknown reason a bookmark was created for every page with a label like "vPDF Page 1". See my output file from your template, attached. I actually ran into this same issue with a bookmark for every page and labels like this earlier in my troubleshooting. I tried running your template on my computer, and on my coworker's computer, both with the same results.


Thanks again for the advice and uploading a sample template, unfortunately the issues persist on the Windows computers here. Seems like this solution could work for others though.


As a workaround, I have added table tags through the variable text editor. I place a start table tag before the title, and a stop table tag after the first line of text that follows a subtitle. The spacing between the last line of text inside table and the first line outside the table is a little off though.


Rule for start table tag

var myTable = "";
// Uncomment the boxrules and cellrules to see the table borders during development.
myTable +=  '<table columns="1" margins="top:0;bottom:1;left:0;right:0;" space="above:0;below:0" ' +
           //'BoxRules="top:thin,black;bottom:thin,black;Left:thin,black;Right:thin,black" ' +
           //'cellrules="top:thin,black;bottom:thin,black;Left:thin,black;Right:thin,black"' +
myTable += '<column width="54000">';
myTable += '<row><cell>';
return myTable;

Rule for stop table tag

return "</table>";


Link to comment
Share on other sites

In the Composition Settings dialog, on the Output tab, un-check the box "Create bookmark for each record."


Thanks. I may have turned on the "Create bookmark for each record" setting by accident. If the bookmarks have names like "vPDF Page 1" in the future I will check that setting.


Attached is my latest sample in a collected zip, and the output PDF it composed. Still experiencing the same issues with incorrect bookmarks and incorrect TOC page numbers unfortunately.



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...