craiger316 General User

Joined: 17 Jan 2005 Posts: 9
|
Posted: Wed Aug 03, 2005 6:56 am Post subject: Margin problems with writer_pdf_Export |
|
|
Hi there, we use the following code to dump MS word docs to PDF format:
| Code: | private void exportAsPDF(XComponent xDoc, String storeUrl) throws java.lang.Exception {
XStorable xStorable = (XStroable)UnoRuntime.queryInterface(XStorable.class, xDoc);
PropertyValue[] storeProps = new PropertyValue[1];
storeProps[0] = new PropertyValue();
storeProps[0].Name = "FilterName";
storeProps[0].Value = "write_pdf_Export";
xStorable.storeToUrl(storeUrl, storeProps);
} |
The only problem is, if the word doc has margins which are really wide, exporting as a PDF programmatically seems to obey the default margins instead of the ones set in the dcoument. If I export the document to PDF right in OO, it works perfectly. This causes grief because now a document which should be one page, ends up on two.
Here is an image of the document in OO and then the resulting PDF generated from the above code (sorry I had to obfuscate it, it contains actual data from our system):
Original in OO: http://www.tataryn.net/~craiger/oo-orig.jpg
Converted to PDF from above code: http://www.tataryn.net/~craiger/post-conf-pdf.jpg
If you are using IE, make sure the image is zoomed to 100% so you can see the margin outlines in the first image.
Notice the addres/phone number info in the top of the document is all wrapped at the margins (causing the text in the entire document to be pushed down).
Anyone else have this problem? Or could suggest a solution?
Thanks,
Craig. |
|