Exporting to pdf from Open office Writer
October 11, 2007 MS Office, Open Office, xml No CommentsOne of main reason for me to choose Open Office over Microsoft Words is that I can convert my document to PDF without installing (or buying) other software. As for my work at Uni, Open Office is main tools used by our clients to create their documents and I have been hacking around with Open Office xml files to meet the customer expectation.
When I play around with Open Office fonts today, I found out one bug when I try to export one of my client’s document to PDF. The document is successfully exported to PDF, but some of the characters are missing in the PDF file. I have been sitting in front of my computer try to figure out why the characters are gone where as when I created a new document with those characters, they appear in the PDF file. Sitting the whole two hours trying to compare the style.xml (I crashed vim and crimson editor for at least 20 times because my box has only 512 RAM and style.xml consists too many lines) and content.xml files, and finally I managed to work out why the characters are not included in the PDF file.
You can replicate the problem by doing these step:
- Create writer document
- Put some text in with an “en dash” (–) character. You can insert this character from open office using <Alt> + <0150> on your number keypad or <Ctrl> + <-> (May not work in some dialog boxes).
- Select all the text (including “en dash” character) and change the font to “Helvetica” (only).
- Save the document and start to export the document to PDF
- Open the PDF file and your “en dash characters are gone”
The error is found for document created in Words opened and exported in Open Office with the above font as well. I don’t know if this is an open office bug as “Helvetica” (standard “Arial” font in Neo Office) is not belong to font list (there is only “Helvetica-Narrow”) because after I replace the style to Helvetica-Narrow the “en dash” appear in the PDF.
Modification that I made in style.xml file is changing:
<style:text-properties style:font-name=”Helvetica” fo:font-size=”8.5pt” fo:font-style=”normal”/>
to:
<style:text-properties style:font-name=”Helvetica-Narrow” fo:font-size=”8.5pt” fo:font-style=”normal”/>
I try to search of the issue report in open office, and seems like this issue had been reported previously related Helvetica included in PDF export in Issue 81970. I have reported the issue to Open Office (Issue 82540) and still waiting for the response
. My client insists on using Helvetica (only) font even Arial has the same view because changing the font name may break other system that use the same document.
Few hours later….
As I predicted, Open office closed Issue 82540 and suggested to use other font that is supported by Open office like “Helvetica-Narrow”. Well, I think that will be the solution for my case for a time being.
