Creating Documents Having Different File Formats

The LEADTOOLS Document Writers SDK can create the following types of file formats:

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

Initialize the LEADTOOLS Document Writers SDK by calling L_DocWriterInit. In addition to initialization this function creates the document handle and sets the format type and format options for the file being created. Each format has its own specific options. These options are passed when the L_DocWriterInit function is called.

The L_DocWriterInit function also sets the progress callback function which shows the job’s progress. The callback function must adhere to the function prototype described in the STATUSCALLBACK function.

To add a page to a new document file, call the L_DocWriterAddPage. This function uses the data in the DOCWRTPAGE structure,which provides information about the page to be inserted. It should have a valid EMF handle for the page to be created. When creating a PDF file an overlay image can be added to the inserted page if the bitmap handle member at DOCWRTPAGE has valid data and DOCWRTPDFOPTIONS is correctly initialized.

Use the L_DocWriterConvert function to convert a file from the LEADTOOLS Temporary Document (LTD) format to any of the listed document file formats. Conversion from LTD format to LTD format is not permitted.

After adding all of the new pages, call the L_DocWriterFinish function to finish file writing and create the document file. This function also frees all allocated resources.