• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to append bytes dynamically to pdf file

 
Veerabhadra Rao
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
From client program, i am readin pdf file in bytes and sending it to server program.

in server program, i need to append the bytes to pdf file.

How to achieve this.
 
Winston Gutkowski
Bartender
Pie
Posts: 10509
64
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Veerabhadra Rao wrote:From client program, i am readin pdf file in bytes and sending it to server program.
in server program, i need to append the bytes to pdf file.

Firstly: Welcome to JavaRanch, Veerabhadra.

Now for the bad news: I'm afraid your question is MUCH too vague to answer.

Simply put: You can't just "add bytes" to a PDF file unless you know that, after adding those bytes, you will still have a valid PDF file. And that will depend entirely on the internal structure and format of a PDF file itself, which - although now an open standard - is NOT simple.

Please have a look at The HowToAskQuestionsOnJavaRanch page and re-submit your question.

Winston
 
fred rosenberger
lowercase baba
Bartender
Posts: 12186
34
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Winston Gutkowski wrote:You can't just "add bytes" to a PDF file unless you know that, after adding those bytes, you will still have a valid PDF file. And that will depend entirely on the internal structure and format of a PDF file itself, which - although now an open standard - is NOT simple.

The OP did not state they wanted a valid PDF when they were done. (yes, i'm being pedantic here, but that really is what programming is all about).

So, if you don't care if the PDF is valid, you should be able to open it with a file writer, move to the end, and add them on. However, you will then NOT be able to open the PDF with a pdf reader.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic