How to convert pdfstamper to byte array -
How to convert pdfstamper to byte array -
in application, need read existing pdf , add together barcode existing pdf , pass output stream. here existing pdf template. using itext jar adding barcode.
i want know possibilities of converting pdfstamper
object byte array or pdfcontentbyte
byte array. can help on this?
your question unclear. assume want write bytearrayoutputstream
instead of fileoutputstream
. there different examples on how on itext web site.
see instance formservlet illustration says:
// create outputstream new pdf bytearrayoutputstream baos = new bytearrayoutputstream(); // create pdf pdfstamper stamper = new pdfstamper(reader, baos);
then later in example, this:
// write pdf bytes outputstream outputstream os = response.getoutputstream(); baos.writeto(os);
if want byte[]
, can this:
byte[] pdfbytes = baos.tobytearray();
i hope question wasn't writing pdfcontentbyte
stream byte[]
because wouldn't create sense: content stream doesn't contain resources such fonts, images, form xobjects, etc...
arrays byte itext pdfstamper
Comments
Post a Comment