aspose file tools*
The moose likes Java in General and the fly likes how to append bytes dynamically to pdf file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "how to append bytes dynamically to pdf file" Watch "how to append bytes dynamically to pdf file" New topic
Author

how to append bytes dynamically to pdf file

Veerabhadra Rao
Greenhorn

Joined: Mar 13, 2013
Posts: 1
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

Joined: Mar 17, 2011
Posts: 7795
    
  21

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

Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11314
    
  16

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.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to append bytes dynamically to pdf file