Delphi.NET – How to convert PDF to WORD
Hi Everyone!
Firstly, you need to download the latest distribution of SautinSoft’s SautinSoft.PdfFocus: Скачать
More information about the component:SautinSoft.PdfFocus
Secondly, you must have installed the development environment Delphi. In this example, I’m using Delphi .Net 2009 for Microsoft .NET.
I will build a simple windows application with one button. Clicking by this button will launch the PDF to Word conversion.
Let’s get started...
Run the development Delphi environment. Create a new project.
You will see this form:
![](/products/pdf-focus/help/net/data/images/Delphi%20environment.png)
Next add a reference to the PDF Focus.Net library. In the package (pdf_focus_net.zip), which you have downloaded from here, browse the folder “/ Bin/Net 2.0” and choose the file SautinSoft.PdfFocus.dll.
![](/products/pdf-focus/help/net/data/images/add%20reference.png)
Click on the Reference right mouse button. Then, on the .Net Assemblies, click Browse and navigate to the directory with the SautinSoft.PdfFocus.dll.
![](/products/pdf-focus/help/net/data/images/add%20reference%20Sautinsoft.png)
Then click OK. You will see that the Reference to SautinSoft.PdfFocus library has been added.
Now add a standard button from the Tool Palette. Let’s name the button – «Convert».
![](/products/pdf-focus/help/net/data/images/add%20standard%20button.png)
Ok, the most difficult part of the project is done. J It remains to add a few lines of code and we get a comprehensive PDF converter.
Double-click on the Convert button and get into the source code of our project.
In the directory Uses you need to add some libraries (ShellApi, SautinSoft):
![](/products/pdf-focus/help/net/data/images/uses.png)
In the directory Var declare additional variable (f):
![](/products/pdf-focus/help/net/data/images/var.png)
Finally, it is necessary to prescribe the actions that will take place after we press the Convert button:
![](/products/pdf-focus/help/net/data/images/procedure.png)
I will do some explaining.
The library SautinSoft.PdfFocus has many options for converting PDF to WORD, PDF to IMAGES, PDF to HTML, PDF to EXCEL. We’ve used only the one direction: PDF to WORD. However, no one is stopping you to experiment with a variety of additional parameters, which are very well described in the documentation: https://www.sautinsoft.com/products/pdf-focus/
f.OpenPdf(…) – specify the path to the PDF file which you want to convert.
f.ToWord(…) – specify the path to a Word file, which will appear as a result of the conversion.
If the conversion is successful, then the Doc file will open automatically in a standard text editor (such as MS Word).
So… to compile the project and launch our project:
![](/products/pdf-focus/help/net/data/images/compile%20project.png)
After clicking the button, the PDF file – simple_text.pdf, converted to the Doc file – result.doc
![](/products/pdf-focus/help/net/data/images/9-1024x561.png)
You can save the entire project to the disk and experiment with other PDF files.
![](/products/pdf-focus/help/net/data/images/simple%20text%20pdf.png)
If you have any questions about the transformation of PDF document to Doc, Images or any formats, please email: [email protected]
Our other components to convert different document formats can be found here: www.sautinsoft.com.
Если вам нужен пример кода или у вас есть вопрос: напишите нам по адресу [email protected] или спросите в онлайн-чате (правый нижний угол этой страницы) или используйте форму ниже: