/** * Return the current page size */ public Dimension getPageSize() { DocumentAtom docatom = _documentRecord.getDocumentAtom(); int pgx = (int) docatom.getSlideSizeX() * Shape.POINT_DPI / Shape.MASTER_DPI; int pgy = (int) docatom.getSlideSizeY() * Shape.POINT_DPI / Shape.MASTER_DPI; return new Dimension(pgx, pgy); }
/** * Change the current page size * * @param pgsize * page size (in points) */ public void setPageSize(Dimension pgsize) { DocumentAtom docatom = _documentRecord.getDocumentAtom(); docatom.setSlideSizeX(pgsize.width * Shape.MASTER_DPI / Shape.POINT_DPI); docatom.setSlideSizeY(pgsize.height * Shape.MASTER_DPI / Shape.POINT_DPI); }
/** * Returns the ExObjList, which holds the references to * external objects used in the slides. This may be null, if * there are no external references. * * @param create if true, create an ExObjList if it doesn't exist */ public ExObjList getExObjList(boolean create) { if (exObjList == null && create) { exObjList = new ExObjList(); addChildAfter(exObjList, getDocumentAtom()); } return exObjList; }
@Override public Dimension getPageSize() { DocumentAtom docatom = _documentRecord.getDocumentAtom(); int pgx = (int)Units.masterToPoints((int)docatom.getSlideSizeX()); int pgy = (int)Units.masterToPoints((int)docatom.getSlideSizeY()); return new Dimension(pgx, pgy); }
@Override public void setPageSize(Dimension pgsize) { DocumentAtom docatom = _documentRecord.getDocumentAtom(); docatom.setSlideSizeX(Units.pointsToMaster(pgsize.width)); docatom.setSlideSizeY(Units.pointsToMaster(pgsize.height)); }
if (lst == null) { lst = new ExObjList(); _documentRecord.addChildAfter(lst, _documentRecord.getDocumentAtom()); try { Field f = Document.class.getDeclaredField("exObjList");
if (lst == null) { lst = new ExObjList(); _documentRecord.addChildAfter(lst, _documentRecord.getDocumentAtom());
/** * Add a hyperlink to this presentation * * @return 0-based index of the hyperlink */ public int addHyperlink(Hyperlink link) { ExObjList lst = (ExObjList) _documentRecord.findFirstOfType(RecordTypes.ExObjList.typeID); if (lst == null) { lst = new ExObjList(); _documentRecord.addChildAfter(lst, _documentRecord.getDocumentAtom()); } ExObjListAtom objAtom = lst.getExObjListAtom(); // increment the object ID seed int objectId = (int) objAtom.getObjectIDSeed() + 1; objAtom.setObjectIDSeed(objectId); ExHyperlink ctrl = new ExHyperlink(); ExHyperlinkAtom obj = ctrl.getExHyperlinkAtom(); obj.setNumber(objectId); ctrl.setLinkURL(link.getAddress()); ctrl.setLinkTitle(link.getTitle()); lst.addChildAfter(ctrl, objAtom); link.setId(objectId); return objectId; } }
if (lst == null) { lst = new ExObjList(); _documentRecord.addChildAfter(lst, _documentRecord.getDocumentAtom());