This is a brief guide of VeryPDF PDF Toolbox Component for .NET for .NET developers.
1. Function interface | 2. Usage guides | 3. Notes |
---|
string RunCMD(string strCmd)
Call the PDF editing operations with this function interface. Use return values to check the result or error code.
1) Run "install.bat" as administrator to register "PDFToolBoxCom.dll".
2) Run "Microsoft Visual Studio 2010", and then choose "Windows Forms Application Visual C#" project and then save the test project. (as shown in Figure 1)
Fig. 1. Choose "Windows Forms Application Visual C#" for test
3) In Microsoft Visual Studio, select menu "Project" -> "Add Reference". (as shown in Fig. 2)
Fig. 2. "Add Reference" in Microsoft Visual Studio
4) Browse and select "PDFToolBoxCom.dll" to load the DLL for the project. (as shown in Fig. 3)
Fig. 3. Add "PDFToolBoxCom.dll" to project
5) For a test, you may add a "button" control to a Windows form and use the following code to add the button function - split PDF.
private void button1_Click(object sender, EventArgs e)
{
string strExePath =
System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
PDFToolBoxCom.PDFToolBoxCom p = new PDFToolBoxCom.PDFToolBoxCom();
string strReturn = p.RunCMD(strExePath + @"\html2pdf.pdf -split");
}
If you want to split a multipage PDF (D:\temp\verypdf.pdf) to single-page PDF, you may use the following codes.
private void button1_Click(object sender, EventArgs e)
{
string strExePath =
System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
PDFToolBoxCom.PDFToolBoxCom p = new PDFToolBoxCom.PDFToolBoxCom();
string strReturn = p.RunCMD("\"D:\\temp\\verypdf.pdf\" -split -outfile
D:\\temp\\out%d.pdf");
}
1) Keep these files in one directory before using them.
libiconv2.dll pdfcore.dll pdfsdk.dll pdftoolbox.dll PDFToolBoxCom.dll
2) Run "install.bat" as an Administrator.
3) Do not hesitate to contact us (http://support.verypdf.com/) if you encounter any problems when use VeryPDF PDF Toolbox Component for .NET.