DOCWRTPDFAUTOBOOKMARK

typedef struct _DOCWRTPDFAUTOBOOKMARK 
{ 
   L_UINT uStructSize; 
   L_BOOL bUseStyles; 
   L_BOOL bBold; 
   L_BOOL bItalic; 
   L_DOUBLE dFontHeight; 
   L_CHAR szFaceName[ LF_FACESIZE ]; 
} DOCWRTPDFAUTOBOOKMARK, *pDOCWRTPDFAUTOBOOKMARK; 

The DOCWRTPDFAUTOBOOKMARK structure provides information about creating automatic bookmark based on font information for PDF document.

Members

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:

Value Meaning
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:

Value Meaning
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:

Value Meaning
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.

Comments

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:

Example EMF document

In the above figure we have the following fonts:

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:

PDF document

Notes:

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.

The structure is used by:

Help Version 20.0.2020.4.3
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help