On 23/10/2010 15:51, Long Botond wrote:
The first 9 pages are valid but the 10th page is unreadable by my PDF
reader. What can be the problem?
I know this doesn't really answer your question,
but I've tried the PDF you've provided with the
code that is added in attachment.
I couldn't produce the problem you're describing.
I tried with iText 5.0.4 first, and it worked.
Then I tried iText 5.0.1 and it also worked.
--
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info
import java.io.FileOutputStream;
import java.io.IOException;
import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.pdf.PdfCopy;
import com.itextpdf.text.pdf.PdfReader;
public class CopyExcel {
public static void main(String[] args) throws IOException,
DocumentException {
PdfReader reader = new PdfReader("Excel97.pdf");
int n = reader.getNumberOfPages();
for (int page = 0; page < n; ) {
Document document = new Document();
PdfCopy copy = new PdfCopy(document, new
FileOutputStream("result_" + page + ".pdf"));
document.open();
copy.addPage(copy.getImportedPage(reader, ++page));
document.close();
}
}
}------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
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