Beispiel #1
0
 /**
  * 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));
   }
 }
Beispiel #2
0
  @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());
  }
Beispiel #3
0
 /**
  * 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));
 }
Beispiel #4
0
 /** 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);
 }
Beispiel #5
0
 /**
  * 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);
 }
Beispiel #6
0
 /**
  * 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));
 }