views:

879

answers:

1

So, I have used Pdf995's PDF print driver from a web browser to print web pages and eventually use PdfEdit995 to join these various PDF files into one large PDF.

Now I have a lot of large PDF documents that I wish to add bookmarks to, but am hoping there is a relatively easy way of doing this programmatically (using C#, preferably) - basically, I want to find, within each PDF, text that is large enough to qualify as a header, and use that text as the bookmark.

Any tips/advice/direction? Thanks!

A: 

It's definitely possible to do this, but I would recommend finding a PDF library that does most of the leg work. Technically you could do it all yourself with the aid of the PDF specification, but that'd probably take more time than it's worth.

The library will need to be able to let you find text in a document and then return the page and size, font, etc, of the text and create bookmarks (also known as outlines) based on that information programmatically.

My companies product, Quick PDF Library, can help you do this and so can PDFKit.NET. I'm sure there are other libraries out there that support this functionality too. As far as free libraries go, from what I've seen I don't believe that PDFSharp or iText will meet all of your requirements in this case, but I'm sure someone will correct me if I'm wrong.

If you'd prefer to develop a solution for this entirely yourself, then the PDF reference is available online for free.

Rowan
I should add that if you have Acrobat then a very good implementation of the feature you're looking for can be found in the Acrobat plug-in, ARTS PDF Aerialist. It's auto bookmark generation feature is very strong.
Rowan
Thanks for the response - I will check into all of these; from what I can tell, iTextSharp or ABCpdf will be what I end up using, although that Acrobat plug-in sounds worth a try too.
Jason Bunting
for plug-ins/commercial tools also check out evermap autobookmark http://www.evermap.com/autobookmark.asp and skysof PDF bookmark 2 http://www.skysof.com/
danio