• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

PDF Water Marker using iText

 
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

This is Santhosh, I am working in product using java,jsp,struts, in that product we need dynamic pdf so, i am creating an pdf using iText at the end of the source i have

bytearrayoutputstream.writeTo(servletoutputstream);
bytearrayoutputstream.flush();
bytearrayoutputstream.close();

only i have bytearrayoutputstream using that how to add water marker and how to write bytearrayoutputstream.writeT(servletoutputstream);

I searched in google, in google i got lot of way to make water marker but thay are using existing pdf so they are using pdfReader to read the pdf but i dont have any pdf now only creating pdf, but i could not use pdfReader, please help me how to add water marker using that bytearrayoutputstream after how to add in servletoutputstream.


Thanks in advance.

 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A PdfReader can be constructed from a byte array or InputStream, so there's no need to create a PDF file.
 
santhosh kumar vk
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

yes i got your point but i have only bytearrayoutputstream this is the final stage,to make a pdf i am using bytearryoutputstream,write(servleteoutputstream),so i have to make water mark using that bytearryoutputstream and i have to write same bytearrayoutputstream into servletoutputstream, can you tell me how to do.


Advance Thanks
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can create a byte[] from a ByteArrayOutputStream (that's the point of a BAOS, after all). Then proceed as mentioned in my previous post.
 
Stop it! You're embarassing me! And you are embarrassing this tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic