ラスター画像は96DPIの解像度で読み込まれているようです。Impressのデフォルトのページサイズ(11.02 "x 8.27")を使用している場合、完全に適合するラスターイメージサイズ(ピクセル単位)は次のとおりです。
1058 x 794
また、このサイズを使用する場合(たとえば、PPTに保存する場合など、おそらく最も互換性のある選択肢であるため)、これがデフォルトであるという事実に依存しないでください。Width
ドキュメントの作成後、任意のページのandプロパティを設定することで、スライドのサイズを設定Height
できます(他のすべてのページは、いずれかのページのサイズを変更した後に続くようです)。
APIは100/mmスケールを使用します。11.02イッチは280mmなので、幅は280 * 100 = 28000、高さは21000です。
プレゼンテーションのサイズを11.02"x8.27"に変更し、ページ全体に合うように(できれば4:3)画像を挿入するJavaの例:
XDrawPage page;
XMultiServiceFactory factory;
// ... setting up the environment and opening document
// resize the page (and all other pages) to our default size
XPropertySet pagePropSet = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, page);
pagePropSet.setPropertyValue("Width", 28000);
pagePropSet.setPropertyValue("Height", 21000);
// create GraphicObjectShape with the size of the page in the top-left corner
Object picture = factory.createInstance("com.sun.star.drawing.GraphicObjectShape");
XShape pictureShape = (XShape)UnoRuntime.queryInterface(XShape.class, picture);
pictureShape.setSize(new Size(28000, 21000));
pictureShape.setPosition(new Point(0, 0));
// load the image file into our the shape
XPropertySet propSet = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, pictureShape);
propSet.setPropertyValue("GraphicURL", new File("c:\\Users\\Vbence\\Downloads\\slide.png").toURI().toURL().toString());
// add the shape to the page
page.add(pictureShape);