aspose-pdf-for-cpp

Are you looking to implement PDF to Word conversion feature in your C++ application? If yes, this article provides one of the best C++ PDF to Word converters that ensures high-speed and high-quality conversion in a few simple steps. So let’s see how to convert PDF files to Word DOC/DOCX in C++.

How to Convert PDF to Word in C++

To convert PDF files to Word DOC or DOCX format, we will use Aspose.PDF for C++. The library lets you read and convert PDF to Microsoft Word file formats with high fidelity. Also, it provides high-speed conversion of PDF files without requiring any complex code. And the good thing is, you can perform PDF to Word conversion free.

You can either install the library through NuGet or download it directly from the downloads section.

PM> Install-Package Aspose.PDF.Cpp

Convert PDF to Word DOC in C++

Aspose.PDF for C++ lets you read a PDF file and convert it to Microsoft Word Binary file format (.doc) with just a couple of lines. The below steps demonstrate the PDF to Word conversion workflow:

  • Load the PDF file from disk of stream using Document class.
  • Save PDF as Word DOC using Document.Save() method. Use the SaveFormat enumeration to specify the output file format as shown in the code sample below.

C++ Code for PDF to Word Conversion

auto doc = MakeObject<Document>(u"..\\Data\\Document\\input.pdf");
doc->Save(u"..\\Data\\Document\\input_out.doc", SaveFormat:: Doc);

Save PDF as DOCX in C++

DOCX is the modern Word Documents file format that is based on Office Open XML file format specifications. Aspose.PDF for C++ can convert PDF files to DOCX with the same simplicity as it converts to DOC file format. This is illustrated in the following sample code.

auto doc = MakeObject<Document>(u"..\\Data\\Document\\input.pdf");
doc->Save(u"..\\Data\\Document\\input_out.docx", SaveFormat::DocX);

Free C++ PDF to Word Converter

You can try Aspose.PDF for C++ without evaluation limitations by getting [a free temporary license][32].

Explore PDF to Word Converter

Want to try it out? Download your free copy of the Aspose.PDF for C++ and get started in no time by following the detailed developer guide from the documentation. In case of any queries, feel free to write to us on Aspose.PDF forum to get further assistance.

Conclusion

In this article, you have learned how to convert PDF to Word in C++. The code samples have demonstrated how to perform PDF to DOC and PDF to DOCX conversions in a couple of steps. You can easily integrate the provided code into your C++ applications.