ExcelTechnology
Methods to Split PDF Documents for General User and Programmers
It has a size limit when we want to submit a PDF document online. Therefore, we may need to split it into several smaller documents. Generally speaking, we can split it based on page numbers, file size and top-level bookmarks.
For General User
Adobe Acrobat is the most frequently used tool to operate PDF documents. Then, I want to share how to split PDF documents with Adobe Acrobat.
1. Click Split Document on Document menu after opening the PDF document we want to split.
2. Click Number of page and then enter the page numbers that each split document will have.
3. Click File Size and enter the size that each split document will be.
4. Click Top-level bookmarks to split a PDF document.
5. For additional options, click Output Options. We can save the documents to a specified path and give file names.
6. For splitting additional documents, Click Apply to Multiple and select the documents which we want to split. Then click OK to save them by giving a specified path and file names.
For Programmer or Tool Designer
Actually, there are many other tools which are used to split PDF documents. The tools are offered for general users who just want to click button simply to meet requirements. For programmers or tool designers, they need to realize this function programmatically. It is common to split PDF document with C#.
Also, I want to share a method to split PDF with C#.
This method needs us to install one add-in, Spire.PDF.
using System;
using Spire.Pdf;
namespace SplitDocument
{
class Program
{
static void Main(string[] args)
{
//open pdf document
PdfDocument doc = new PdfDocument(@"Sample3.pdf");
String pattern = "SplitDocument-{0}.pdf";
doc.Split(pattern);
String lastPageFileName
= String.Format(pattern, doc.Pages.Count - 1);
doc.Close();
//Launching the Pdf file.
System.Diagnostics.Process.Start(lastPageFileName);
}
}
}
In this article, I show how to split PDF documents, one for general user, and the other for PDF. Although the two methods need to use tool or add-in, they are simple and useful!
Create PDF File in ASP.NET
At present, blog is widely used by people. The blog owners post their articles or posts. It is possible that some posts are very useful for others, for example, knowledge about health, design. Even, some people want to print the articles.
Therefore, if authors publish the articles on blog or other article websites, they may consider to creating articles with PDF format because PDF is suitable for any operation system platform and convenient for viewing and printing.
Recently, I found a way to create PDF in ASP.NET. Although it is not perfect, in my opinion, it is very helpful.
ASP.Net programming language allows users to create PDF files dynamically by clicking a button or link.
How to Create PDF in ASP.Net
1. Go to the Web hosting control panel and then log in with users name and password.
2. Check if PDF2NET, PDFNET, or PDFRasterizer library folder exists in /libraries, /plugins or /includes folder. Before we generate PDF file with ASP code, one of these libraries should be existed. Generally speaking, the Web hosting companies provide us on or more of PDF libraries. If we cannot find the library folder, contact the provider to search for help.
3. Open the HTML file which we want to create PDF file in a text or HTML editor. Then, find the place where the link button will display in the HTML code. Create the object by following code to add the needed libraries reference.
Set pdf = Server.CreateObject("FdfApp.FdfApp")
Set pdf_file = FdfAcx.FDFCreate
4. Create PDF header value to personalize web document based on information provided by site visitors. The following code shows how to set first, middle and last name in the PDF file.
pdf_file.fdfsetvalue "Mary", FirstName, false
pdf_file.fdfsetvalue "J", MI, false
pdf_file.fdfsetvalue "Doe", LastName, false
5. Next, save the PDF file. pdf_file.FDFSaveToFile "/pdfFiles/generated_file.pdf
6. Open the PDF file in the user’s Web brower.
"http://www.abc.com/pdfFiles/generated_file.pdf"
Response.ContentType = "text/html"
7. Save the HTML file in the editor and upload the file to the Web server.
Create PDF File in ASP.NET
At present, blog is widely used by people. The blog owners post their articles or posts. It is possible that some posts are very useful for others, for example, knowledge about health, design. Even, some people want to print the articles.
Therefore, if authors publish the articles on blog or other article websites, they may consider to creating articles with PDF format because PDF is suitable for any operation system platform and convenient for viewing and printing.
Recently, I found a way to create PDF in ASP.NET. Although it is not perfect, in my opinion, it is very helpful.
ASP.Net programming language allows users to create PDF files dynamically by clicking a button or link.
How to Create PDF in ASP.Net
1. Go to the Web hosting control panel and then log in with users name and password.
2. Check if PDF2NET, PDFNET, or PDFRasterizer library folder exists in /libraries, /plugins or /includes folder. Before we generate PDF file with ASP code, one of these libraries should be existed. Generally speaking, the Web hosting companies provide us on or more of PDF libraries. If we cannot find the library folder, contact the provider to search for help.
3. Open the HTML file which we want to create PDF file in a text or HTML editor. Then, find the place where the link button will display in the HTML code. Create the object by following code to add the needed libraries reference.
Set pdf = Server.CreateObject("FdfApp.FdfApp")
Set pdf_file = FdfAcx.FDFCreate
4. Create PDF header value to personalize web document based on information provided by site visitors. The following code shows how to set first, middle and last name in the PDF file.
pdf_file.fdfsetvalue "Mary", FirstName, false
pdf_file.fdfsetvalue "J", MI, false
pdf_file.fdfsetvalue "Doe", LastName, false
5. Next, save the PDF file. pdf_file.FDFSaveToFile "/pdfFiles/generated_file.pdf
6. Open the PDF file in the user’s Web brower.
"http://www.abc.com/pdfFiles/generated_file.pdf"
Response.ContentType = "text/html"
7. Save the HTML file in the editor and upload the file to the Web server.
