The DOCWRTPDFAUTOBOOKMARK structure provides information about creating automatic bookmark based on font information for PDF document.
|uStructSize||Size of this structure in bytes, for versioning. Use the sizeof() to calculate this value.|
|bUseStyles||Flag that indicates whether to enable or disable checking for the font styles such as bold or italic while creating the bookmark in the PDF document using the automatic bookmarking feature. Possible values are:|
|TRUE||Enables checking the font styles.|
|FALSE||Disables checking the font styles. This is the default value.|
|bBold||Flag that indicates whether to create bookmarks based on font is bold. Possible values are:|
|TRUE||Create bookmarks based on font is bold.|
|FALSE||Do not create bookmarks. This is the default value.|
|bItalic||Flag that indicates whether to consider only italic font for the selected font type and size while creating bookmark in the PDF document. Possible values are:|
|TRUE||Consider only italic font for the selected font type and size while creating bookmark in the PDF document.|
|FALSE||Do not consider italic. This is the default value.|
|dFontHeight||The Font height to be considered for the font which will be used for creation bookmark in PDF document. The default value is 0.|
|szFaceName||Specifies a null-terminated string that specifies the typeface name of the font.|
pDOCWRTPDFAUTOBOOKMARK is a pointer to a DOCWRTPDFAUTOBOOKMARKstructure. Declaring a pDOCWRTPDFAUTOBOOKMARK variable is necessary only if your program requires a pointer.
The Bookmarks feature allows for the creation of bookmarks, which can be used to mark parts of a document, for quick access. This can be done with documents that have been consistently formatted in outline or chapter form with sections and sub-sections, where each level uses unique font formatting to indicate each section.
When bUseStyles is TRUE this means to consider font styles, when considering unique fonts inside the document, for example in that case Arial bold and Arial will be handled as two different fonts.
Document Writer AutoBookmark feature will create bookmarks automatically for well structured documents that have unique fonts for its table of contents. The document must be constructed with this kind of convention in mind in order for the Auto book-marking feature to work properly. An example EMF document is shown in the following figure:
In the above figure we have the following fonts:
"Chapter": come with font: Arial17pt Bold
"Section": come with font: Tahoma 13pt
"Sub Section": come with font: Times New Roman 12pt Italic
To set the bookmarks for a document, first set the number of levels of bookmarks that you want. "Levels" represent the hierarchy of the bookmarks in the resultant bookmark outline. In our example there are three levels to be turned into bookmarks, so the number of Levels is 3.
For first level of bookmark, you should set the szFaceName to Arial and set bUseStyles to TRUE, with bBold equal to TRUE and bItalic equal to FALSE, and fontsize equal to 17.
For second level of bookmark, you should set the szFaceName to Tahoma and set bUseStyles to FALSE, and fontsize equal to 13.
For third level of bookmark, you should set the szFaceName to Times New Roman and set bUseStyles to TRUE, with bBold equal to FALSE and bItalic equal to TRUE, and fontsize equal to 12.
The resultant PDF document should be as following figure:
The order of fonts is same as the order of levels (i.e. the first font will be in level 1, the 2nd in level 2 and so on).
Font selections should not conflict. Selecting "Arial" 17pt with same styles for both level1 and level2 will not work. Each level setting should be unique.
The maximum number of bookmarks cannot be greater than 10 levels and is limited by the number of unique fonts available in the loaded document. In the example used, it is limited to 3.
Before using the LEADTOOLS Document Writers SDK, unlock it by using the L_SetLicenseFile function. If you want to use the PDF format you must also unlock PDF support with the L_SetLicenseFile function.
Medical Web Viewer .NET
.NET, Java, Android, and iOS/macOS Assemblies
C API/C++ Class Libraries