Convert Word Doc to PDF in C++

Posted on 2019-12-17 Nick Villalobos

Document Converter Header

LEAD is continuously updating and adding new features to LEADTOOLS. One feature that was rolled into Version 19 after the initial release includes enhanced SVG support. This enhancement allows users to load document and vector formats as SVG, which can then be handed off to other parts of LEADTOOLS such as the Document Writers. In other words, you can convert from formats such as DOC, PDF, DWG, DXF, etc. to other document formats such as PDF/A, HTML, and SVG without rasterization or OCR.

In Convert a Word Document to PDF (C#), I attached a project to show how to do the conversion in .NET. Now I have attached a C/C++ version of the project that will convert vector and document formats to PDF.

What it Does

This C/C++ console application project shows how to use LEADTOOLS to convert a Word DOC to document-based PDF.

Features Used

Download the project

Supports More Than Just PDF!

Changing the output format to something other than PDF is trivial. Just find the line below and change the format.

nRet = L_DocWriterInit(
   &hDocWriter,
   (L_TCHAR*)targetFile, 
   DOCUMENTFORMAT_PDF, 
   NULL, NULL, NULL);

P.S.

This is why getting LEADTOOLS annual maintenance is so important; it ensures that you always get the latest features of LEADTOOLS such as these SVG enhancements.

LEADTOOLS Blog

LEADTOOLS Powered by Apryse,the Market Leading PDF SDK,All Rights Reserved