Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adding attachment to pdf

 
Naresh Chaurasia
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following source code:



The above code has src as source pdf file, dest as destination pdf file and temp file to be attached to the src file to generate dest file.

I want to integrate this code with my existing application. The existing application uses different technology(not itext) to generate pdf using following piece of code.



The variable data holds Byte Array equivalent of pdf. Later in the application the data is flushed as follows in servlet as follows



I want to attache a file to this pdf byte array stored in the variable. Please let me know if it is possible. I have tried a couple of things to store the data in temporary pdf, and then add attachment to it and then flush the new byte, but it is not working as expected.

Please advise if i am following correct approach.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic