Creating Documents Having Different File Formats
The LEADTOOLS Document Writers SDK the functionality for creating the following types of document file formats:
Adobe Portable Document Format (PDF).
Microsoft Word document format (DOC).
Microsoft Word 2007 document format (DOCX).
Microsoft Rich Text Format (RTF).
HyperText Markup Language (HTML).
Windows Enhanced Meta File (EMF).
Text file format.
Microsoft XML Paper Specification format (XPS)
LEADTOOLS Temporary Document (LTD). This format creates a temporary file on disk that can later be converted to any of the other formats supported by the LEADTOOLS Document Writers.
User-defined document format. This format is not used inside the LEADTOOLS Document Writers toolkit. The User format can be used as an output format when used in the LEADTOOLS OCR toolkit as a special case to instruct the OCR framework to save the document using the engine’s native format. refer to Programming with LEADTOOLS OCR.
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.
The L_DocWriterInit function also sets the progress callback function which shows the job’s progress. This callback function must adhere to the function prototype described in the STATUSCALLBACK function.
Each format has its own specific options. These options are passed when the L_DocWriterInit function is called.
To add a page to a new document file, call the L_DocWriterAddPage. This function uses the data in DOCWRTPAGE. DOCWRTPAGE 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.
After adding all of the new pages, call L_DocWriterFinish to finish file writing and create the document file. This function also frees all allocated resources.
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.
The LEADTOOLS Document Writers SDK must be unlocked before the user can actually use its features.
PDF format requires a special key to unlock. When using this format you have to first unlock the specified support.