/** * Gets a duplicate of this <CODE>PdfContentByte</CODE>. All * the members are copied by reference but the buffer stays different. * * @return a copy of this <CODE>PdfContentByte</CODE> */ public PdfContentByte getDuplicate() { PdfContentByte cb = new PdfContentByte(writer); cb.duplicatedFrom = this; return cb; }
/** * Gets a duplicate of this <CODE>PdfContentByte</CODE>. All * the members are copied by reference but the buffer stays different. * * @return a copy of this <CODE>PdfContentByte</CODE> */ public PdfContentByte getDuplicate() { PdfContentByte cb = new PdfContentByte(writer); cb.duplicatedFrom = this; return cb; }
/** * Constructs a <CODE>PdfWriter</CODE>. * <P> * Remark: a PdfWriter can only be constructed by calling the method * <CODE>getInstance(Document document, OutputStream os)</CODE>. * * @param document The <CODE>PdfDocument</CODE> that has to be written * @param os The <CODE>OutputStream</CODE> the writer has to write to. */ protected PdfWriter(final PdfDocument document, final OutputStream os) { super(document, os); pdf = document; directContentUnder = new PdfContentByte(this); directContent = directContentUnder.getDuplicate(); }
/** * Constructs a <CODE>PdfWriter</CODE>. * <P> * Remark: a PdfWriter can only be constructed by calling the method * <CODE>getInstance(Document document, OutputStream os)</CODE>. * * @param document The <CODE>PdfDocument</CODE> that has to be written * @param os The <CODE>OutputStream</CODE> the writer has to write to. */ protected PdfWriter(final PdfDocument document, final OutputStream os) { super(document, os); pdf = document; directContentUnder = new PdfContentByte(this); directContent = directContentUnder.getDuplicate(); }
/** * Gets an instance of a Image from a java.awt.Image. * The image is added as a JPEG with a user defined quality. * * @param writer * the <CODE>PdfWriter</CODE> object to which the image will be added * @param awtImage * the <CODE>java.awt.Image</CODE> to convert * @param quality * a float value between 0 and 1 * @return an object of type <CODE>PdfTemplate</CODE> * @throws BadElementException * on error * @throws IOException */ public static Image getInstance(final PdfWriter writer, final java.awt.Image awtImage, final float quality) throws BadElementException, IOException { return getInstance(new PdfContentByte(writer), awtImage, quality); }
protected void setNewPageSizeAndMargins() { pageSize = nextPageSize; if (marginMirroring && (getPageNumber() & 1) == 0) { marginRight = nextMarginLeft; marginLeft = nextMarginRight; } else { marginLeft = nextMarginLeft; marginRight = nextMarginRight; } if (marginMirroringTopBottom && (getPageNumber() & 1) == 0) { marginTop = nextMarginBottom; marginBottom = nextMarginTop; } else { marginTop = nextMarginTop; marginBottom = nextMarginBottom; } if (!isTagged(writer)) { text = new PdfContentByte(writer); text.reset(); } else { text = graphics; } text.beginText(); // we move to the left/top position of the page text.moveText(left(), top()); if (isTagged(writer)) textEmptySize = text.size(); }
protected void setNewPageSizeAndMargins() { pageSize = nextPageSize; if (marginMirroring && (getPageNumber() & 1) == 0) { marginRight = nextMarginLeft; marginLeft = nextMarginRight; } else { marginLeft = nextMarginLeft; marginRight = nextMarginRight; } if (marginMirroringTopBottom && (getPageNumber() & 1) == 0) { marginTop = nextMarginBottom; marginBottom = nextMarginTop; } else { marginTop = nextMarginTop; marginBottom = nextMarginBottom; } if (!isTagged(writer)) { text = new PdfContentByte(writer); text.reset(); } else { text = graphics; } text.beginText(); // we move to the left/top position of the page text.moveText(left(), top()); if (isTagged(writer)) textEmptySize = text.size(); }
writer.getDirectContent().duplicatedFrom = graphics; } else { graphics = new PdfContentByte(writer);
writer.getDirectContent().duplicatedFrom = graphics; } else { graphics = new PdfContentByte(writer);