Home > Products Windows > PDF Parse & Modify Component for .NET
PDF Parse & Modify Component for .NET $395.00

VeryPDF

PDF Parse & Modify Component for .NET

  • Analyze and return positions characters in PDF.
  • Obtain font style and color of text in PDF.
  • Convert PDF to HTML and images in .NET applications.

Download Buy Now

How to use VeryPDF PDF Parse & Modify Component for .NET?

The key file of VeryPDF PDF Parse & Modify Component for .NET is pdfparsersdk2.dll, which is a Win32 dynamic link library (DLL), and you should call it by APIs in your programing (e.g., C#). The following is examples showing how to use this DLL.

1. Download the package of VeryPDF PDF Parse & Modify Component for .NET, and extract it to any folder in your disk, for example, D:\temp\pdfparsersdk.

2. Run development suite, e.g., Microsoft Visual Studio 2010, and then open project file "D:\temp\pdfparsersdk\C#\CSharp_WindowsFormsApplication1\CSharp_WindowsFormsApplication1.sln".

Open demo project file of VeryPDF PDF Parse & Modify Component for .NET
Open demo project file of VeryPDF PDF Parse & Modify Component for .NET

In the opened file, as shown in Fig. 1, you will see the
CSharp_WindowsFormsApplication1 class and some interface functions of
pdfparsersdk2.dll.

Examples of interface functions:
The followings are some function code which can be directly used in your C# code.
4. Compile the C# project and created an executable file

"CSharp_WindowsFormsApplication1.exe". Run the executable file, and then you will see its interface as displayed in Fig. 2.

Interface of compiled C# demonstration project
Fig. 2 Interface of compiled C# demonstration project

5. In the interface shown in Fig. 2, click the first button, and then you will get the following files:

out_pg_0001.htm

out_pg_0001.png

• out_pg_0001.htm is a plain text file which contains data in format below:

666,78,84,14,MORGAN;

761,78,90,14,STANLEY;

862,78,57,14,FIXED;

930,78,76,14,INCOME;

1017,78,107,14,RESEARCH;

Before each word (string), the four numbers give the position (Left, Top, Width, and Height) of the word. Data blocks are separated by semicolon ";".
If you want to output the data in XML, please use argument "-html" in option "strOptions",
for example, do as in the following code.


Recompile the project, and run the generated "CSharp_WindowsFormsApplication1.exe", you will get a new "out_pg_0001.htm" which stores data in formats like the below.
Strings and the positions are stored in the HTML file.
out_pg_0001.png is an image rendered from the PDF page.
Each string in out_pg_0001.png has the same position as stored in out_pg_0001.htm. If you view out_pg_0001.htm by a web browser, you will see that strings in the PNG image and HTML file are precisely overlapped as shown in Fig. 3.

 View the created HTML file in a web browser
Fig. 3 View the created HTML file in a web browser

6. To modify the text in a PDF, please use the demonstration project "D:\temp\pdfparsersdk\VB.NET_ModifyTextInPDF\WindowsApplication1\WindowsApplication1.sln". Compile the project, and then you will get the demonstration executable file "VB_NET_ModifyTextInPDF.exe". Run the executable file and load a test PDF. You will see the interface as shown in Fig. 4.

Modify a PDF with compiled demo application
Fig. 4 Modify a PDF with compiled demo application

If you want to replace MORGAN with VeryPDF, input the position information (Left, Top, Width, and Height), the original text "MORGAN" in Old Text, and the target text "VeryPDF" in New Text, as displayed in Fig. 5.

Replace text in PDF with demo application
Fig. 5 Replace text in PDF with demo application

Click the button Replace Text in PDF, and then the text "MORGAN" will be replaced with "VeryPDF" as shown in Fig. 6.

Result of text replacement
Fig. 6 Result of text replacement

The replacement operation can also be performed by VB.NET codes as follows:

If you have any questions in using VeryPDF PDF Parse & Modify Component for .NET, please contact us (http://support.verypdf.com/).

Discount 45% ($49.90) to buy PDF to Word Converter, PDF to Excel Converter, and PDF to PowerPoint Converter.

Relative Products

Gold Support 30-DAY NO RISK REFUND
 
  See other products   Download   Buy Now