Hi,
All objects are closed correctly and we get a document with size > 0kb. The document opens in most cases correctly but for some users adobe reader gives the error "file does not begin with %PDF". If we open the file with notepad it indeed doesn't show the "%PDF <version>" in the beginning.
We have been doing some text and if we use
stamper.setFormFlattening(false);
we get a "well-formed" PDF-document.
If we use
stamper.setFormFlattening(true);
we get a pdf-document without the %PDF<version> in the beginning.
The content of the document looks like the document registerd_flat.pdf that is on
http://itextdocs.lowagie.com/tutorial/general/copystamp/index.html> PDFStamper
It seems that adobe reader 7 requires the %PDF to be in the document, adobe reader 6 doesn't require this because using Adobe Reader 6 the documents open correctly.
Regards,
Igor
========================= [EMAIL PROTECTED] =========================
From: Bruno Lowagie <[EMAIL PROTECTED]>
Reply-To: Post all your questions about iText here <[EMAIL PROTECTED]>
To: Post all your questions about iText here <[EMAIL PROTECTED]>
Subject: Re: [iText-questions] File does not begin with %PDF after usingformflattening
Date: Fri, 13 Apr 2007 10:16:47 +0200
>Igor Vernelen wrote:
> > Hi,
> >
> > We use iText to fill out formfields in PDF-documents (kind of
> > mailmerge). However after using the formflattening option the generated
> > pdf-document does no longer begin with %PDF <version number>. This gives
> > a problem for some users (seems to be Adobe Reader 7 related ?) ...
> >
> > How can we use the formflattening an still have correct PDF-documents
> > (i.e. containing %PDF <version> in the beginning of the document) ?
>
>I think there's something else going on here,
>because PdfStamper usually produces valid PDF files
>starting with %PDF.
>
>A first check: are you sure you are closing the PdfStamper
>object? Because if you forget, the file will have 0 bytes.
>
>This being said: are you sure the program isn't throwing
>an exception before the stamper is closed?
>
>Have you looked at the file that is produced?
>If you're producing it in a web application,
>are you sure, it's not an HTML error page sent
>to you by the webserver because the app threw
>an exception?
>
>br,
>Bruno
>
>-------------------------------------------------------------------------
>Take Surveys. Earn Cash. Influence the Future of IT
>Join SourceForge.net's Techsay panel and you'll get the chance to share your
>opinions on IT & business topics through brief surveys-and earn cash
>http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>_______________________________________________
>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/
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ 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/