/** * Sets the top margin. * * @see #getTopInset() * @param margin the top margin */ public void setTopInset(double margin) { CTTextBodyProperties bodyPr = getTextBodyPr(); if (bodyPr != null) { if (margin == -1) bodyPr.unsetTIns(); else bodyPr.setTIns(Units.toEMU(margin)); } }
@Override public void setData(byte[] data) throws IOException { byte[] compressed = compress(data, 0, data.length); NativeHeader nHeader = new NativeHeader(data, 0); Header header = new Header(); header.wmfsize = data.length; header.bounds = nHeader.deviceBounds; Dimension nDim = nHeader.getSize(); header.size = new Dimension(Units.toEMU(nDim.getWidth()), Units.toEMU(nDim.getHeight())); header.zipsize = compressed.length; byte[] checksum = getChecksum(data); ByteArrayOutputStream out = new ByteArrayOutputStream(); out.write(checksum); if (uidInstanceCount == 2) { out.write(checksum); } header.write(out); out.write(compressed); setRawData(out.toByteArray()); }
/** * Change the current page size * * @param pgsize page size (in points) */ public void setPageSize(Dimension pgsize) { DocumentAtom docatom = _documentRecord.getDocumentAtom(); docatom.setSlideSizeX(Units.pointsToMaster(pgsize.width)); docatom.setSlideSizeY(Units.pointsToMaster(pgsize.height)); }
/** Return the current page size */ 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); }
/** * Sets the page size to the given <code>Dimension</code> object. * * @param pgSize page size */ public void setPageSize(Dimension pgSize) { CTSlideSize sz = CTSlideSize.Factory.newInstance(); sz.setCx(Units.toEMU(pgSize.getWidth())); sz.setCy(Units.toEMU(pgSize.getHeight())); _presentation.setSldSz(sz); }
/** * Returns the current page size * * @return the page size */ public Dimension getPageSize() { CTSlideSize sz = _presentation.getSldSz(); int cx = sz.getCx(); int cy = sz.getCy(); return new Dimension((int) Units.toPoints(cx), (int) Units.toPoints(cy)); }