Please take a look at this StackOverflow question: Extracting one page from pdf file using iText, it contains a small code snippet that "burst" a PDF:
public static void main(String[] args) throws DocumentException, IOException {
PdfReader reader = new PdfReader("resources/Abdomen.pdf");
int n = reader.getNumberOfPages();
reader.close();
String path;
PdfStamper stamper;
for (int i = 1; i <= n; i++) {
reader = new PdfReader("resources/abdomen.pdf");
reader.selectPages(String.valueOf(i));
path = String.format("results/abdomen/p-%s.pdf", i);
stamper = new PdfStamper(reader,new FileOutputStream(path));
stamper.close();
reader.close();
}
}
"Bursting" means: to split a PDF with X pages into X PDFs with a single page. If you only need a single page, you don't need to loop over the different pages, you can just use the code inside the for
-loop to select one page.
The syntax of the parameter of the selectPages()
method is explained in the answer to this question: PDF Page re-ordering using itext.
All of this is done in Java using iText, but if you prefer C#, we also have iTextSharp. There is a free ebook The Best iText Questions on StackOverflow that contains an abundance of code samples in Java as well as in C#.