래스터 이미지가 96 DPI 해상도로로드 된 것 같습니다. 당신이 다음 임프레스의 기본 페이지 크기 (11.02 "X 8.27") (픽셀 단위) 완벽하게 피팅 래스터 이미지 크기를 사용하는 경우입니다 :
1058 X 794
또한,이 고수 경우 크기 (아마도 PPT에 저장할 때 아마도 가장 호환 가능한 선택 일 것입니다), 이것이 기본값이라는 사실에 의존하지 마십시오. 문서를 만든 후에는 페이지의 Width
및 Height
속성을 설정하여 슬라이드의 크기를 설정할 수 있습니다. 다른 페이지의 크기를 조정 한 후에 다른 모든 페이지가 뒤따를 것으로 보입니다.
API는 100/mm 스케일을 사용합니다. 11.02 iches가 280mm이므로, 너비가 280 * 100 = 28000이고, 높이 11.02 "X 8.27"에 presentaion 크기를 조절하고 (a 바람직하게는 4 : 3)로 삽입 21000.
자바 예는 화상 맞게 전체 페이지 :
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);