This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Other JSE/JEE APIs and the fly likes PDF to Editable Format(RTF/HTML) & back to PDF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "PDF to Editable Format(RTF/HTML) & back to PDF" Watch "PDF to Editable Format(RTF/HTML) & back to PDF" New topic
Author

PDF to Editable Format(RTF/HTML) & back to PDF

ravi D shankar
Ranch Hand

Joined: May 27, 2005
Posts: 41
Hi

Sorry if this question doesnt belong to this sub-forum.
I am working on an issue which had a PDF file generated using iText.
The pdf file contains only formatted text and the requirement is to edit (add/remove content) from the PDF. For this purpose I was thinking whether this is possible using any free java api. I was looking at Google Docs where a document can be saved as a PDF again.
Using iText I think I can generate RTF(also HTML minus the pagebreaks etc) but is it possible to convert it back to PDF with same formatting of text.
Just wanted to buzz people to know whether something like this is possible.

Thanks in advance
Ravi
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41591
    
  55
Basically, no. Very few operations are possible on PDF files once they are generated. Adobe Acrobat Professional can perform some editing, but there's no public API -free or commercial- for this.


Ping & DNS - my free Android networking tools app
moto raja
Ranch Hand

Joined: May 28, 2005
Posts: 55
Hi Ravi,


I have, in fact, tweaked into the source code of and was successful in using the OpenOffice2.1 framework API to convert RTF/Word etc. documents into a pdf document on the fly..
It provides for a proper-formatting and conversion from any of the readalbe formats like text, word-docs etc into pdf without using acrobat reader.

You may as well try the same.

Let me know if you need further help.

Regards,
Moto.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41591
    
  55
Originally posted by moto raja:
I have, in fact, tweaked into the source code of and was successful in using the OpenOffice2.1 framework API to convert RTF/Word etc. documents into a pdf document on the fly.


The question is about editing an existing PDF document, so this approach does not help, as OO can not open PDF documents.
moto raja
Ranch Hand

Joined: May 28, 2005
Posts: 55
Hi Dittmer,

I'm pretty sure that OO can open pdf documents.
I have a version of OO Installable on my machine and I just opened a pdf doc.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41591
    
  55
Originally posted by moto raja:
I'm pretty sure that OO can open pdf documents.
I have a version of OO Installable on my machine and I just opened a pdf doc.

I stand corrected. That's impressive on OO's part. Is it possible to edit the document, or to save to an editable format? That's really what is being asked here.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8876
    
    8

Originally posted by moto raja:
I have a version of OO Installable on my machine and I just opened a pdf doc.


That's news to me. I just tried to open a PDF with 2.2.0 on Ubuntu Linux and 2.2.1 on WinXP and they both opened the PDF as a source file (i.e. plain ASCII text) not as a rendered document. In any case, OpenOffice will not allow you to edit a PDF and save it (AFAIK).


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41591
    
  55
That's what NeoOffice does on my OS X (opening the ASCII source), but I wasn't sure if OO might be doing something more.
 
Consider Paul's rocket mass heater.
 
subject: PDF to Editable Format(RTF/HTML) & back to PDF