/** * 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); }
/** * Write the contents of the record back, so it can be written * to disk */ public void writeOut(OutputStream out) throws IOException { // Header out.write(_header); // The sizes and zoom ratios writeLittleEndian((int)slideSizeX,out); writeLittleEndian((int)slideSizeY,out); writeLittleEndian((int)notesSizeX,out); writeLittleEndian((int)notesSizeY,out); writeLittleEndian((int)serverZoomFrom,out); writeLittleEndian((int)serverZoomTo,out); // The master persists writeLittleEndian((int)notesMasterPersist,out); writeLittleEndian((int)handoutMasterPersist,out); // The ID of the first slide writeLittleEndian((short)firstSlideNum,out); // The slide size type writeLittleEndian((short)slideSizeType,out); // The booleans as bytes out.write(saveWithFonts); out.write(omitTitlePlace); out.write(rightToLeft); out.write(showComments); // Reserved data out.write(reserved); }
@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)); }
/** * Write the contents of the record back, so it can be written * to disk */ public void writeOut(OutputStream out) throws IOException { // Header out.write(_header); // The sizes and zoom ratios writeLittleEndian((int)slideSizeX,out); writeLittleEndian((int)slideSizeY,out); writeLittleEndian((int)notesSizeX,out); writeLittleEndian((int)notesSizeY,out); writeLittleEndian((int)serverZoomFrom,out); writeLittleEndian((int)serverZoomTo,out); // The master persists writeLittleEndian((int)notesMasterPersist,out); writeLittleEndian((int)handoutMasterPersist,out); // The ID of the first slide writeLittleEndian((short)firstSlideNum,out); // The slide size type writeLittleEndian((short)slideSizeType,out); // The booleans as bytes out.write(saveWithFonts); out.write(omitTitlePlace); out.write(rightToLeft); out.write(showComments); // Reserved data out.write(reserved); }