ASP.NET PDF Processing SDK Component

ASP.NET PDF Processing SDK Component

Platform : Windows 10, Windows 8, Vista, Windows 7, XP

This SDK for ASP.NET and Desktop Windows Developer to add PDF Editing features in your Web Application or Desktop Application.

Popular Solution Go   Back

ASP.NET - How to merge PDF files on ASP.NET 2019

1. Assuming that you have already run the ASP.NET PDF Processing SDK Component installation program and started visual studio 2019, the next step is create a new project, select ASP.NET Web Application(.NET Framework). Click Next.


2. Select Empty - selected Web Forms , click Create button.

3. In Solution Explorer, selected References, right click the mouse, select Add Reference... , select Browse, select PDFProcessingWrapper.dll from
C:Program Files (x86)ASP.NET PDF Processing SDK Componentbin folder, then click OK.


4. Select WebApplication1 in Solution Explorer, right click the mouse, select Add - New Items... , select Web Form, enter the Default.aspx name.
then click Add.

5. Select WebApplication1 in Solution Explorer, right click the mouse, select Add - New Folder, rename the folder to output and Add - New Folder again.
named uploads.

6. Select output folder, add pdf file in uploads folder, named test.pdf.

7. Open Default.aspx.cs, add the following import statements to the top of the page.
using System.Web.Services;
using PDFProcessingWrapper;

8. Add RotatePDFPage function and Create an instance of ASP.NET PDF Processing SDK Component and then call Rotate method.
[WebMethod]
public static string RotatePDFPage(string strInputPDFFile1, int iPageNumber, int iRotation)
{
var myUniqueFileName = string.Format(@"{0}.pdf", Guid.NewGuid());

PDFProcessing obj = new PDFProcessing();
string stroutpath = HttpContext.Current.Server.MapPath("~/output/" myUniqueFileName);
string strinputpath1 = HttpContext.Current.Server.MapPath("~/uploads/" strInputPDFFile1);
bool bResult = obj.Rotate(strinputpath1, stroutpath, iPageNumber - 1, iRotation);

if (bResult)
  return "Rotate successful";
else
   return "Rotate Page Failed";

}

9. add the following code in Page Load event,it will rotate page 1 to 90 degree.
protected void Page_Load(object sender, EventArgs e)
{
Response.Write( RotatePDFPage("test.pdf", 1, 90));


10. Press F5 run the project, it will output the pdf in output folder.