Forum Feature requests

PDF Bookmark functionality when combining multiple documents

bizguy72
Hi,

Two PDF bookmark features I would like to see added to the roadmap, both revolve around when you're combining two or more html documents into a PDF:

For the purposes of an example, let's say I have three HTML files to combine into a PDF:

file 1:
File name: "Plants.html"
HTML page <title>: "Native Plants of Australia"

file 2:
File name: "Wildlife.html"
HTML page <title>: "Native Wildlife of Australia"


file 3:
File name: "Trees.html"
HTML page <title>: "Native Trees of Australia"

First desired feature would be an option to create PDF bookmarks based on the File name (with a sub option to include/exclude the file extension). So after Prince has finished I would have three bookmarks:

Plants.html
Wildlife.html
Trees.html

OR

Plants
Wildlife
Trees

Second desired feature would be an option to create PDF bookmarks based on the <title> of each page. So after Prince has finished I would have three bookmarks:

Native Plants of Australia
Native Wildlife of Australia
Native Trees of Australia

Thanks
Adam
mikeday
Right, at the moment bookmark elements need to appear in the output, so <title> cannot be used as it is within <head> and has "display: none" specified. The closest you could get at present could be to use <h1> or a div with empty content:
<div class="bookmark">Native Plants</div>

div.bookmark {
    prince-bookmark-level: 0;
    content: none
}

This will create a bookmark without any text appearing on the page.
bizguy72
mikeday wrote:
Right, at the moment bookmark elements need to appear in the output, so <title> cannot be used as it is within <head> and has "display: none" specified.....


Thanks Mike,

I don't understand what you mean by has "display: none" specified (where is this specified precisely?), however I infer from the rest of what you have said is that basically as the <title> is within the <head> section, Prince can't use that to create a bookmark within the generated PDF file.

Regards
Adam
mikeday
That's basically the case. The default style sheets have the following rules:
head { display: none }
title { display: none }
style { display: none }

This is to ensure that text in these elements does not leak into the document, where it is not supposed to be displayed. Technically only the first rule should be necessary, but sometimes people write strange documents where the title or style elements are not correctly nested within the head.