I got the following to work, but it is still giving me this error.
"This document contained certain rights to enable special features in Adobe
Reader. The document has been changed since it was created and these rights
are no longer valid. Please contact the author for the original version of
this document."
ByteArrayOutputStream baos = new ByteArrayOutputStream();
com.lowagie.text.pdf.PdfReader pdfReader = new
com.lowagie.text.pdf.PdfReader("http://ServerURL/newpdf.pdf");
com.lowagie.text.pdf.PdfStamper pdfStamper = new
com.lowagie.text.pdf.PdfStamper(pdfReader, baos);
com.lowagie.text.pdf.AcroFields pdfFormFields =
pdfStamper.getAcroFields();
pdfFormFields.setField("NAME_FIRST", "Chad");
//This doesn't seem to work
//pdfStamper.setFormFlattening(false);
pdfStamper.close();
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition",
"attachment;filename=vha-10-2850-fill.pdf");
Response.Buffer = true;
Response.Clear();
Response.OutputStream.Write(baos.toByteArray(), 0, baos.size());
Response.OutputStream.Flush();
Response.End();
>From what I read, the latest iText was supposed to keep this error from
happening in Adobe 9. iTextSharp just hadn't caught up to it.
Will iText or iTextSharp ever allow us to fill a PDF template (written with
the newest Adobe Designer), edit it in browser, and save it to desktop with
those changes? All the while being opened by Adobe 8, 9 and and up?
Thanks for your feedback.
Chad
henslecd wrote:
>
> Until iTextSharp is in sync with iText, I am using iText with IKVM to get
> the dll's I need.
>
> I just have a couple questions that should be straight forward. I need to
> know what to change in the following code (where commented out) to get the
> pdf to stream to a browser.
>
> //in iTextSharp, this line would be a MemoryStream
> //java.io.OutputStream newpdf; //new
> FileOutputStream("c:\\temp\\test.pdf");
>
> com.lowagie.text.pdf.PdfReader pdfReader = new
> com.lowagie.text.pdf.PdfReader("http://ServerURL/Oldpdf.pdf");
> com.lowagie.text.pdf.PdfStamper pdfStamper = new
> com.lowagie.text.pdf.PdfStamper(pdfReader, newpdf);
> com.lowagie.text.pdf.AcroFields pdfFormFields =
> pdfStamper.getAcroFields();// AcroFields;
>
> pdfFormFields.setField("NAME_FIRST", "Test");
>
> pdfStamper.setFormFlattening(true);
> pdfStamper.close();
>
> Response.ContentType = "application/pdf";
> Response.AddHeader("content-disposition",
> "attachment;filename=nameofpdf.pdf");
> Response.Buffer = true;
> Response.Clear();
>
> //There is no such method as GetBuffer in the java.io.OutputStream
> object
> //Response.OutputStream.Write(newpdf.GetBuffer(), 0,
> newpdf.GetBuffer().Length);
>
> Response.OutputStream.Flush();
> Response.End();
>
> Thanks for any help you can provide.
>
> Chad
>
--
View this message in context:
http://www.nabble.com/iText-IKVM-C--stream-to-browser-issues-tp22483298p22486837.html
Sent from the iText - General mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php