Hello, I am hoping someone can help me... I am using OpenOffice SDK 3.3 with OpenOffice, (I also tried with LibreOffice), and find that after I insert an image using code like:
Object newImage = xWriterFactory_dest.createInstance("com.sun.star.text.TextGraphicObject"); XTextContent xNewTextContent = (XTextContent) UnoRuntime.queryInterface(XTextContent.class, newImage); XPropertySet xProps = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, newImage); xProps.setPropertyValue("GraphicURL", strImgFileName); xProps.setPropertyValue("AnchorType", TextContentAnchorType.AS_CHARACTER); xText.insertTextContent(xTextCursor, xNewTextContent, false); xProps.getPropertyValue("IsPixelContour"); xProps.setPropertyValue("Width", width); xProps.setPropertyValue("Height", height); xProps.setPropertyValue("HoriOrient", new Short(HoriOrientation.NONE)); xProps.setPropertyValue("VertOrient", new Short(VertOrientation.NONE)); xProps.setPropertyValue("HoriOrientPosition", new Integer(x)); xProps.setPropertyValue("VertOrientPosition", new Integer(y)); to insert an image at a certain character position... After inserting, I then set the size which seems to work for OpenOffice. The images are sized correctly and linked accordingly. However when I try to save/export the document to it's MS Word format. I see that the picture frame (the frame prior to having its contents loaded/prior to fetching the URL), are set to the correct size, however after Word fetches the actual picture file, the image no longer fit within the image size I set and seems to reflect the images true file size (the actual image size) rather than the width and height that I set the image to open in. If you know of a way to set the actual image size once it has loaded/fetched for Word, I'd appreciate any assistance. Kind Regards, Chris -- View this message in context: http://openoffice.2283327.n4.nabble.com/Opening-the-file-in-MS-Word-linked-images-wrong-size-tp3263558p3263558.html Sent from the openoffice - api dev mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org