Esempio n. 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));
   }
 }
Esempio n. 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());
  }
Esempio n. 3
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);
 }