PDA

View Full Version : Creating bookmarked pdf document



anu_swar
6th April 2015, 09:39
Hi,

I want to generate a pdf document. I will be using QPrinter to write contents(text and images) to pdf document.
Is there a way to create bookmark(index) for pdf document so that all bookmarks are displayed in left panel?

Thanks

Radek
6th April 2015, 10:35
AFAIK, no. Poppler is "read-only" as well as MuPdf (they cannot manipulate the pdf, only read). PoDoFo should be able to create ToC but, IMO, ToC is buggy in PoDoFo so that the app will fail most likely - you can try because you'll create the ToC from scratch instead of manipulating ToC. My experience is that manipulating fails because of bad linking of ToC in PoDoFo. Humuus is "write-only" (it can only create the pdf from scratch). AFAIK, Qt cannot create ToC.

Well, the only chance is VirtualBox, get winblows somehow (don't ask how), get Acrobat somehow (don't ask how) and make the ToC in Acrobat.

anda_skoa
6th April 2015, 12:25
Well, the only chance is VirtualBox, get winblows somehow (don't ask how), get Acrobat somehow (don't ask how) and make the ToC in Acrobat.
I would be surprised if there aren't some libraries that can create PDFs with metadata.
After all pdflatex is a tool that can do that so it is imlpementable ouside of Adobe.

Cheers,
_

Radek
6th April 2015, 16:53
pdflatex needs a .tex source, not a .pdf. As to the libraries, it seems to be a sad reality. Once upon a time, I wanted to write a utility able of a few basic fixups of .pdf's. Namely, creating or fixing ToC and removing pages. I searched for a library able of fixing ToC (for starters, removing pages was planned later). The whining above is a result of my searching. Now, I am using VirtualBox with XP (no network) and Acrobat in trial mode.

anda_skoa
6th April 2015, 17:10
pdflatex needs a .tex source, not a .pdf.

Well, obviously.
It it still a non-Adobe product capable of generating PDFs with all kinds of features, including ToC, interactive links, etc.

So there is no technical reason why a library for PDF creation couldn't offer the same capabilities.



As to the libraries, it seems to be a sad reality.

There are tons of PDF libraries, I would be surprised of none of them had the necessary features.
easyPDF for example can do bookmarks.



Once upon a time, I wanted to write a utility able of a few basic fixups of .pdf's. Namely, creating or fixing ToC and removing pages.
pdfjam can do quite a lot

Cheers,
_

Radek
6th April 2015, 17:59
I am speaking about a C or C++ API able of manipulating PDF files. The source file is a .pdf, the target file is a .pdf, too. There aren't tons of libraries of this kind. easyPDF is a converter, pdfjam can rotate and flip pages, make 2-column PDF and similar things.

anda_skoa
6th April 2015, 18:48
easyPDF is a converter

I was obviously refering to the easyPDF library/SDK.



pdfjam can rotate and flip pages, make 2-column PDF and similar things.
And remove pages, one of the things you mentioned earlier.

Cheers,
_