Hi,
I am really not sure if I got the point. However if you want to take all
A4 pages out of a input pdf file consisting of A3 and A4 pages that
are unsorted then you can easily do it with a old version of the
itexttoolbox from the time when it was part of itext. There you can list
all pages using the selectedpages plugin and the sort according to the
width or hight or offset. After that it is easy to mark all pages of one
size because they are grouped together then and write the resulting pdf
file to disk.
Best regards,
Carsten
osmoz7 schrieb:
> Hi,
>
> I'm trying to split a pdf file according to an array of offsets and
> fragment's lengths. I have found the following solution, but I am not sure
> if it is the right way to do it.
>
> PdfReader reader = new PdfReader("myfile.pdf");
>
> for (int i = 0; i < beginIndexArray.length; i++) {
>
> FileOutputStream foStream = new FileOutputStream("myfragment"+i+".pdf");
> PRStream prStream = new PRStream(reader, beginIndexArray[i] );
> prStream.setLength(fragmentLengthArray[i] );
> Document pdfFragmentDoc = new Document();
> PdfWriter pdfFragmentWriter = PdfWriter.getInstance(pdfFragmentDoc ,
> foStream);
> prStream.toPdf(pdfFragmentWriter, foStream);
> }
>
> The javadoc API is not very clear about the use of toPdf() method. At the
> end, I have fragments of the pdf file, they are readable by Acrobat 8, but
> opening it with PDF-Analyzer
> (http://www.softpedia.com/get/Office-tools/PDF/PDFAnalyzer.shtml) leads to
> an error message.
> Any help would be greatly appreciated. Thanks!
>
> Amir
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/