Please help. I'm new to this.
I'm currently creating a PDF file using buffer (byteArrayOutputStream) but I
also have a pdf with acrofields that I want to add to the beginning of this.
How can I do this?
response.setContentType("application/pdf");
Document document = new Document();
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
PdfWriter writer = PdfWriter.getInstance(document, buffer);
document.open();
// FONTS
Font font1 = new Font(Font.HELVETICA, 10, Font.BOLD);
document.add(new Paragraph("TEST",font1));
document.close();
DataOutput dataOutput = new DataOutputStream(response.getOutputStream());
byte[] bytes = buffer.toByteArray();
response.setContentLength(bytes.length);
for(int i = 0; i < bytes.length; i++) {
dataOutput.writeByte(bytes[i]);
}
--
View this message in context:
http://itext-general.2136553.n4.nabble.com/Append-pdf-to-one-created-by-ByteArrayOutputStream-tp2279726p2279726.html
Sent from the iText - General mailing list archive at Nabble.com.
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions:
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/