I have two PDF files that I concatenate using PdfSmartCopy. Since 5.4.1 texts
in second PDF on concatenated PDF are not ok. Compare pdf2.pdf with last
page of pdf2.pdf.

        public static void main(String[] args) throws Exception {
                final String[] files = new String[] {"C:/Temp/pdf1.pdf",
"C:/Temp/pdf2.pdf"};
                final File file3 = new File("C:/Temp/pdf3.pdf");
                
                final FileOutputStream fout = new FileOutputStream(file3);
                final Document document = new Document();
                final PdfSmartCopy copy = new PdfSmartCopy(document, fout);
                
                document.open();
                
                for (final String pdfFile : files) {
                        final PdfReader reader = new PdfReader(pdfFile);
                        for (int page = 1; page <= reader.getNumberOfPages(); 
page++) {
                                copy.addPage(copy.getImportedPage(reader, 
page));
                        }
                        copy.freeReader(reader);
                        reader.close();
                }
                
                document.close();
        }

pdf1.pdf <http://itext-general.2136553.n4.nabble.com/file/n4658560/pdf1.pdf>  
pdf2.pdf <http://itext-general.2136553.n4.nabble.com/file/n4658560/pdf2.pdf>  
pdf3.pdf <http://itext-general.2136553.n4.nabble.com/file/n4658560/pdf3.pdf>  



--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/PdfSmartCopy-error-since-5-4-1-tp4658560.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
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