dear sir:

    i want to split a pdf file using itext, here is my source code in java:


/////////////////////////////////////////////////////////////////////////////////////
        PdfReader reader = new PdfReader(filePath);
        int pageCnt = reader.getNumberOfPages();

        for (int i = 0; i < pageCnt; i++) {

         Document document = new
Document(reader.getPageSizeWithRotation(i+1));
         PdfSmartCopy copy = new PdfSmartCopy(document, new
FileOutputStream(filePath
                    .substring(0, filePath.length() - 4)
                    + "-" + (i + 1) + ".pdf"));

            document.open();

            copy.addPage(copy.getImportedPage(reader, i+1));
            document.close();
            copy.close();
        }



        after that, i found the totle files' size is 350MB, but the
origin pdf file size is only 6MB,

       in "itext in action", it said to use  PdfSmartCopy instead of PdfCopy
,  then i tried and found the result is the same.

       any help?
------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to