I have several PDF files with fields that get populated with data.
These forms get combined to form a single PDF which is then
sent to a users browser.
When this file is printed from a few users machines it fails to print
and gives a limitcheck error with offending command of gsave.
This happens regardless of whether the file was first saved or
printed directly from AR. The error is evidently a postscript
problem where there are too many graphics states pushed onto
the stack..
When the file is saved it is 615 KB. If I then open this file directly
with AR and print using the CutePDF print driver to another PDF
file the new PDF file size goes down to 216 KB. When I open this
new PDF file and print it to an actual printer that has the
limitcheck problem it prints fine.
What can I do in iText to remove the limitcheck gsave error and
reduce the file size?
The iText code(from several online samples) does the following:
For each document, write its document fields
1.Load PDF file containing fields and set the field values - uses
PdfReader, PdfStamper, AcroFields
2.Write the PDF document to a MemoryStream object - the writer
has CloseStream set to false.
For each successive document, once it has its data installed into
the fields, it is concatenated with the prior PDF memory stream to
form the growing PDF document. I tried three different ways to
concatenate the streams and they all work but none of them solve
the problem. The three different ways are:
1.Using PdfContentByte, PdfImportedPage, PdfReader, PdfWriter,
and Document, iteratively add the pages from each of the two
documents being merged.
2.Using PdfCopy, PdfImportedPage, PdfReader, PdfWriter, and
Document, iteratively add the pages through the PdfCopy object.
3.Using two PdfReaders, and a PdfCopyFields simply use the
AddDocument() method of the PdfCopyFields object.
In none of these implementations is the
PdfContentByte.SaveState or RestoreState used.
I can supply PDF files and code.
Thanks,
Gery Dorazio
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
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/