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.

Member

Description

uStructSize

Size of this structure in bytes, for versioning. Use the sizeof() to calculate this value.

bUseStyles

Flag that indicates whether to consider font styles when creating document bookmark. Possible values are:

 

Value

Meaning

 

TRUE

Consider font styles upon creation bookmark.

 

FALSE

Neglect font styles.

bBold

Flag that indicates whether to consider bold font style for the selected font while creating bookmark for PDF document. Possible values are:

 

Value

Meaning

 

TRUE

Consider only bold font for the selected font type and size while creating bookmark for PDF document.

 

FALSE

Do not consider bold.

bItalic

Flag that indicates whether to consider italic font style for the selected font type and size while creating bookmark for PDF document. Possible values are:

 

Value

Meaning

 

TRUE

Consider only italic font for the selected font type and size while creating bookmark for PDF document.

 

FALSE

Do not consider italic.

dFontHeight

The Font height to be considered for the font which will be used for creation bookmark in PDF document.

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:

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:

 

 

Notes:

 

Before using the LEADTOOLS Document Writers SDK, unlock it by using the L_UnlockSupport function. If you want to use the PDF format you must also unlock PDF support with the L_UnlockSupport function.

This structure is used with the L_DocWriterConvert and L_DocWriterInit functions.