Package org.jpedal.tools
Class PdfPageSplit
java.lang.Object
org.jpedal.tools.PdfPageSplit
Utility class with static methods to split PDFs into separate files
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Split the PDF at the given page and save the two sections into the specified directory The split will put all pages less than and equal to the specified page in the first file and all pages greater than the specified page in the second file.static void
splitAllPages
(File input, File outputDirectory) Split the provided document to make each page a separate file.static void
splitAllPages
(File input, File outputDirectory, String password) Split the provided document to make each page a separate file.static void
Split the provided document in two 2 documents with the first containing pages 1 to splitPage inclusive and the second containing all other pages.static void
Split the provided document in two 2 documents with the first containing pages 1 to splitPage inclusive and the second containing all other pages.static void
splitToNPagePDFs
(File input, File outputDirectory, int pages) Split the provided document to make files comprising the given number of pages each.static void
splitToNPagePDFs
(File input, File outputDirectory, int pages, String password) Split the provided document to make files comprising the given number of pages each.
-
Method Details
-
main
Split the PDF at the given page and save the two sections into the specified directory The split will put all pages less than and equal to the specified page in the first file and all pages greater than the specified page in the second file.- Parameters:
args
- Expects a String array of 3 values. the first being the filename for the input PDF, the second being the filename for the output, the third being a number of the page to split the file- Throws:
IOException
- if there is an issue opening the PDF file
-
splitIn2
Split the provided document in two 2 documents with the first containing pages 1 to splitPage inclusive and the second containing all other pages.- Parameters:
input
- the file to be splitoutputDirectory
- the directory to save the split output.splitPage
- the page to be used to split the document, this page is included in the first file- Throws:
IOException
- if there is an issue opening the PDF file
-
splitIn2
public static void splitIn2(File input, File outputDirectory, int splitPage, String password) throws IOException Split the provided document in two 2 documents with the first containing pages 1 to splitPage inclusive and the second containing all other pages.- Parameters:
input
- the file to be splitoutputDirectory
- the directory to save the split output.splitPage
- the page to be used to split the document, this page is included in the first filepassword
- the password of the file to have pages deleted- Throws:
IOException
- if there is an issue opening the PDF file
-
splitAllPages
Split the provided document to make each page a separate file.- Parameters:
input
- the file to be splitoutputDirectory
- the directory to save the split output.- Throws:
IOException
- if there is an issue opening the PDF file
-
splitAllPages
public static void splitAllPages(File input, File outputDirectory, String password) throws IOException Split the provided document to make each page a separate file.- Parameters:
input
- the file to be splitoutputDirectory
- the directory to save the split outputpassword
- the password of the file to have pages deleted- Throws:
IOException
- if there is an issue opening the PDF file
-
splitToNPagePDFs
Split the provided document to make files comprising the given number of pages each. The final file will contain any remaining pages up to the specified amount- Parameters:
input
- the file to be splitoutputDirectory
- the directory to save the split output.pages
- the number of pages each output file should contain- Throws:
IOException
- if there is an issue opening the PDF file
-
splitToNPagePDFs
public static void splitToNPagePDFs(File input, File outputDirectory, int pages, String password) throws IOException Split the provided document to make files comprising the given number of pages each. The final file will contain any remaining pages up to the specified amount- Parameters:
input
- the file to be splitoutputDirectory
- the directory to save the split output.pages
- the number of pages each output file should containpassword
- the password of the file to have pages deleted- Throws:
IOException
- if there is an issue opening the PDF file
-