The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

prasanna_soft (27) [Avatar] Offline
I have a question. I am not sure whether this will click.
Earlier during my text file to PDF conversion Lowagie told its not possible to convert word document using iText.
We have something called POI which has HWPF which does read the word files. Is it not possible to read the file using POI and store them in some way and use iText classes to write them in PDF?

I am not able to get the POI.jar.

If anyone have tried this way please help me.

I am not sure about the POI supported classes, please tell me whether my question s valid
blowagie (284) [Avatar] Offline
Re: Word Document to PDF Conversion
First reading the file with Apache POI, then generate the PDF with iText has been advised by others on the iText mailing list. However, I have never tried it myself.
As for the POI jar: this is not an Apache project; the product has nothing in common with iText, but you can find more info about it here: (Follow the download link.)
prasanna_soft (27) [Avatar] Offline
Re: Word Document to PDF Conversion
Got the word document to pdf conversion with some changes left...with respect to formatting like Bold,Italic,Underline, and other things....
Used POI HWPF / msword parse classes and then used iText way of generating PDF.

Need to find out some way to get the alignment...working on that now...
thanks for the information you have provided.
vishu1508 (1) [Avatar] Offline
Re: Word Document to PDF Conversion
Hi Prasanna,
Will u please provide me the solution which u created for converting the doc file into the pdf. And please let me know whethere it supprot for UTF-8 conversion or not?

Thanks in advance...

Message was edited by:
prashanthend (1) [Avatar] Offline
Re: Word Document to PDF Conversion
hi prasanna

Its great that u achieved.
i am also trying for this, but found no solution. will u please provide the solution.

blowagie (284) [Avatar] Offline
Re: Word Document to PDF Conversion
Vishy, Prashanth,
I think you don't fully understand the concept of a forum like this.
The chance that Prasanna sees your messages is almost inexistent.
Please ask elsewhere.
charlesvc (8) [Avatar] Offline
Re: Word Document to PDF Conversion
hi prasanna

I have a request if you like accept it
I too wasted my time on apache poi and then used iText api to write pdf , but u know
HWPF project is still in scratch pad and we can't align correctly and can't get the EMF and other meta files for auto shapes, text box. That are not at all supported,

and then u can try with conversion of doc to xml or xsl-fo document, and then using apache fop u can convert to pdf, but that too is not perfect as the autoshapes and text boxes are not coming correctly

Also with apache poi u know when i read the first page paragraph wise there were autoshapes one line but it came at last.
so u can;t accomplish ur goal with these projects . They are researching on this.

And u know Apache poi is perfect only for xls and ppt documents
u can convert excel sheet or ppt to pdf as u r trying now
but for word document u just try with open office api

the only requirement is u have to install open office api kit separately and update the class path separately don;t put its jar files in java class path.

charles v c
Naveenm1985 (2) [Avatar] Offline
Re: Word Document to PDF Conversion

can you please help me with some sample document for converting word document to PDF. it will be of great useful to me.

i have been trying to use a word document layout and covert it to PDF. The Values for the fields will be fetched from the database. can you please help me with this out.
blowagie (284) [Avatar] Offline
Re: Word Document to PDF Conversion
If you have fields in a Word document, why don't you convert the Word template to PDF using OpenOffice, then fill the fields with iText? Wouldn't that be the easiest solution for your problem?
Anyway: please use the official iText mailing list for further questions:
There's only one person answering questions here (me) and I don't always have the time to visit this forum (I have a son with cancer).
charlesvc (8) [Avatar] Offline
Re: Word Document to PDF Conversion
Hi blowagie

Why we want to use iText if already openoffice can convert word file to pdf, you know it is rubbish to use iText again to fill the fields, I didn't get you
please make it clear.
blowagie (284) [Avatar] Offline
Re: Word Document to PDF Conversion
Suppose you have a database with 30,000+ addresses (for instance: the students at Ghent University).
Suppose you have to send these 30,000+ people a letter (for instance: to invite them to elect the student representatives for the board).
Then you could write this letter using Open Office and define specific fields for the address and a barcode. This is a 1-page PDF.
Then you use iText to create a PDF with 30,000+ almost identical pages, the only difference is the fact that each page has a different address and a different barcode.
In this real world example, this mega PDF goes to a printing office where the letters are printed and put into envelopes automatically.

I don't know why you call this rubbish, but I know plenty of people use iText in completely the wrong way. If they say iText is rubbish, that's not iText's fault, it's the fault of those people who usually don't know what they are doing.

Please follow my advice and have this conversation on the official iText mailing list. This forum is not very active. But you probably already noticed that; I doubt it you received any answer regarding your question to prasanna.
charlesvc (8) [Avatar] Offline
Re: Word Document to PDF Conversion
Hi Blowagie

No i thought for converting pdf we have to use both ooo and iText ok i was not aware of these filling fields, ok .

But you know i text can write a pdf but you know how can we edit or render an existing pdf with iText that is not possible as to my knowledge, we can render using pdfbox or jpedal. That is all.
blowagie (284) [Avatar] Offline
Re: Word Document to PDF Conversion
I don't really understand your English; what you say sounds very ambiguous.

If you own the book, you know that iText can be used to:
* create PDFs (in different ways: high level, low level, using Graphics2D)
* manipulate existing PDFs (this is not the same as 'editing PDF')

iText can't render PDFs. That's a deliberate choice: iText was designed as a server side tool. Having a GUI on the server side doesn't make any sense.

I didn't know PDFBox could render PDF, but there's plenty of other PDF Viewers around.
iText integrates well with JPedal (for instance to add form fields to an existing PDF) and SUN's PDF Renderer (for instance in the RUPS tool to analyze a PDF).

We don't have the intention to provide "Yet Another PDF Viewer". (Why would we? There's no need for it given the many alternatives that are available.)

charlesvc (8) [Avatar] Offline
Re: Word Document to PDF Conversion

You didn;t understand my english, is it rubbish, sorry
i just typed roughly, ok anyway now i am interested to move onto iText so that i can discuss with you more. ok
can you give me the e-mail id.

Also, if i need to change the font in an existing pdf file, how can perform it using iText, that is what my english convey passively.

yes we can extract text and images from pdf file using pdfbox and convert to image the pdf file as a whole.
charlesvc (8) [Avatar] Offline
Re: Word Document to PDF Conversion

Sorry if i am typing here without manners and not making you understood.

anyway you know how many times i updated in sourceforgenet and itext mailing list for this solution at last i found you here.
pls reply me soon there
i am going to update there also
expecting your co-operation, i cease and leave this forum
we can meet there
blowagie (284) [Avatar] Offline
Re: Word Document to PDF Conversion
The address of the mailing list is
but you need to be subscribed as is explained here:

Changing the font of an existing PDF document is A VERY BAD IDEA.
It may be possible with iText, but it has to be done on your own risk.
You won't get any help on the mailing list because we don't encourage
people to use iText for achieving requirements that are made by people
who don't know the first thing about PDF (this is an euphemistic way
of saying that the requirement "change the font of an existing PDF file"
is a very stupid idea).

Read the following recent post on news://comp.text.pdf to find out why
the person who designed your project made a huge mistake:

I don't understand what you are doing with PDFBox. Are you saying you
are rasterizing a PDF? That's also a very bad idea. I fear your project needs
a very thorough redesign because your questions make me fear the worst.
charlesvc (8) [Avatar] Offline
Re: Word Document to PDF Conversion

using pdfbox we can convert pdf to image or extract embedded images i told its possibility compared to iText, which can write only. I am not using this. I just want to convert word to images, that i accomplished already by easy method not this rubbish way.
but i ask you how can we change the font of an existing pdf file using iText
if there is no answer how can find with iText, upto my knowledge it is not possible because we have to change the pdf stream or the encoding
anyway if it is not possible, i also leave the question here at ur request
i don;t need this solution i just asked as this question raised in my mind
blowagie (284) [Avatar] Offline
Re: Word Document to PDF Conversion
I don't understand what you mean by "anyway you know how many times i updated in sourceforgenet and itext mailing list for this solution". If you do a repost of a question that hasn't been answered, please refer to the message in one of the archives.

As for "expecting my cooperation": you know that I have a son with cancer; you also know I am not paid for helping you, so please don't expect too much. Take into account what I just said: if you ask impossible things, or things that demonstrate a very bad taste (for instance replacing he font in an existing PDF), you won't get an answer. Not from me, not from anybody. What you are asking is just "not done" (for many different reasons that you'd understand if you knew more about PDF).
charlesvc (8) [Avatar] Offline
Re: Word Document to PDF Conversion

my sentence convey : i updated several times, but no one has revert back with a solution.

Actually, What happened, you know, Acrobat Viewer bean java api couldn't read the pdf file being converted from word document because it couldn't recognize the font embedded in pdf document. So i assumed at first of changing this Arial like fonts to Heveltica in pdf. So i come with another api to read this pdf, so i left the idea as i too tired of searching for my solution.

But i doubted is there anyway, that is why i am asking you.
blowagie (284) [Avatar] Offline
Re: Word Document to PDF Conversion
"my sentence convey : i updated several times, but no one has revert back with a solution."

to convey: "to transmit or serve as the medium for transmission"
to update: "to bring up to date; supply with recent information"
to revert: "to go back to a previous state"

Your sentence translates as:
"my sentence transmitted: I supplied with recent information several times, but no one went back to a previous state."
What you meant was:
"I meant: I posted the question several times, but no one replied with a solution."

The fact that I have a very hard time understanding your English; the fact that some of your questions are real whereas others are asked just out of curiosity (but how to know the difference?), make me all confused.

IF you posted a question to the mailing list, IT IS ARCHIVED!
Please produce a link to the question you posted.
I don't have the time to find out what you mean.
charlesvc (8) [Avatar] Offline
Re: Word Document to PDF Conversion
Thank you thank you very much in correcting me

ok anyway you got what I meant
or you catch what i meant
I will give the link to you afterwards
now i am going out for a tea
ok anyway i am praying for you sun to get relieved from cancer, if he is strong enough inside in mind, i am sure he will come back soon
prasanna_soft (27) [Avatar] Offline
Re: Word Document to PDF Conversion

Sorry for not in touch for quite long time. Got relocated to another office. Where i don have access to net.
381720 (2) [Avatar] Offline
As for me, I have seldom tried to deal with Word Document to PDF Conversion. I wonder have you ever worked it out? Do I need another 3rd party manual toolkit? When it comes to
PDF conversion process, I have another question, I wonder have you ever tried to convert pdf to other image files before? As for myself, I am testing the related PDF to PNG converting , PDF to BMP converting , and PDF to JPG converting programs these days. Do you have experience about it? Any suggestion will be appreciated. Thanks in advance.

Best regards,