1

This is further to my question Add Page bookmarks to an existing PDF using iTextSharp using C# code

With the guidence of Bruno Lowagie i managed to add pdf bookmarks using iTextShrp, but now i need to add color and bold formatting to the bookmarks.

Please help...

I am sure that it is possible , becuase i used ExportToXML to retrieve an already formatted bookmark, then it is having formatting info as well.

Community
  • 1
  • 1
user3122606
  • 57
  • 1
  • 3
  • 11

2 Answers2

1

Just like in my previous answer, I would like you to please read the documentation.

What you are asking is explained in the CreateOutlineTree example. If bookmark is of type PdfOutline, you can change the style and font like this:

 bookmark.setStyle(Font.BOLD);
 bookmark.setColor(BaseColor.BLUE);

If you look at the C# port of the example, you'll discover a slight difference in iTextSharp:

 bookmark.Style = Font.BOLD;
 bookmark.Color = BaseColor.BLUE; 
Bruno Lowagie
  • 75,994
  • 9
  • 109
  • 165
-1

I've had better luck adding hyperlinks and internal bookmarks to PDFs using a VB DLL and DynamicPDF.