![]() We are using pageNameSuffix variable for giving the sequence number of each file with the PDF original name as sample-1.pdf, sample-2.pdf and so on. In my example, sample.pdf has 102 pages and the interval variable is 10, so each PDF file will contain 10 pages and the last PDF file will contain 2 pages. interval is the page(s) number of the PDF file from where we want to split the original PDF and divide into each new PDF files. Here, pdfFilePath variable is the old PDF location and outputPath variable is the location of new PDF files. Now, I am going to explain the code written above. the code given above, we are using the PdfReader, FileInfo, Document and PdfCopy classes. Write the code in the Program class to extract the pages from one PDF and save into multiple PDF files. We can install, using Package Manager Console with the command given below. ![]() ![]() We have to install iTextSharp through manage NuGet packages, as shown below. We have to follow some simple steps to split the pages from one PDF file and save into multiple PDF files. Sample example is in console applications but in real time, we can use ASP.NET, Web API etc., as per our requirement. Here, in this article, we are going to take a sample example for splitting a PDF file. Sometimes we need to split the pages from one PDF file into multiple PDF files. Please refer to the link given below for PDF, using iTextSharp library. It is an open source library and very useful to CREATE, ADAPT, INSPECT and MAINTAIN documents in the Portable Document Format (PDF). We are going to use iTextSharp library in this article.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |