/** Outputs a <CODE>String</CODE> directly to the content. * @param s the <CODE>String</CODE> */ public void setLiteral(final String s) { content.append(s); }
Type3Glyph(PdfWriter writer, PageResources pageResources, float wx, float llx, float lly, float urx, float ury, boolean colorized) { super(writer); this.pageResources = pageResources; this.colorized = colorized; if (colorized) { content.append(wx).append(" 0 d0\n"); } else { content.append(wx).append(" 0 ").append(llx).append(' ').append(lly).append(' ').append(urx).append(' ').append(ury).append(" d1\n"); } }
/** * Appends an array of bytes. * @param b the array to be appended * @return a reference to this <CODE>ByteBuffer</CODE> object */ public ByteBuffer append(byte b[]) { return append(b, 0, b.length); }
/** * Appends another <CODE>ByteBuffer</CODE> to this buffer. * @param buf the <CODE>ByteBuffer</CODE> to be appended * @return a reference to this <CODE>ByteBuffer</CODE> object */ public ByteBuffer append(ByteBuffer buf) { return append(buf.buf, 0, buf.count); }
/** * Changes the current gray tint for filling paths to black. */ public void resetGrayFill() { saveColor(new GrayColor(0), true); content.append("0 g").append_i(separator); }
/** * Appends a string representation of a <CODE>float</CODE> according * to the Pdf conventions. * @param i the <CODE>float</CODE> to be appended * @return a reference to this <CODE>ByteBuffer</CODE> object */ public ByteBuffer append(float i) { return append((double)i); }
/** * Modify the current clipping path by intersecting it with the current path, using the * even-odd rule to determine which regions lie inside the clipping path. */ public void eoClip() { if (inText && isTagged()) { endText(); } content.append("W*").append_i(separator); }
/** Outputs a <CODE>float</CODE> directly to the content. * @param n the <CODE>float</CODE> */ public void setLiteral(final float n) { content.append(n); }
/** * Changes the current color for filling paths to black. * */ public void resetCMYKColorFill() { saveColor(new CMYKColor(0, 0, 0, 1), true); content.append("0 0 0 1 k").append_i(separator); }
/** * Appends a <CODE>String</CODE> to the buffer. The <CODE>String</CODE> is * converted according to the encoding ISO-8859-1. * @param str the <CODE>String</CODE> to be appended * @return a reference to this <CODE>ByteBuffer</CODE> object */ public ByteBuffer append(String str) { if (str != null) return append(DocWriter.getISOBytes(str)); return this; }
/** * Appends a string representation of a <CODE>double</CODE> according * to the Pdf conventions. * @param d the <CODE>double</CODE> to be appended * @return a reference to this <CODE>ByteBuffer</CODE> object */ public ByteBuffer append(double d) { append(formatDouble(d, this)); return this; }
public void setColorFill(final PdfLabColor lab, float l, float a, float b) { checkWriter(); state.colorDetails = writer.addSimple(lab); PageResources prs = getPageResources(); PdfName name = state.colorDetails.getColorSpaceName(); name = prs.addColor(name, state.colorDetails.getIndirectReference()); saveColor(new LabColor(lab, l, a, b), true); content.append(name.getBytes()).append(" cs "); content.append(l + " " + a + " " + b + " "); content.append("scn").append_i(separator); }
public void setColorStroke(final PdfLabColor lab, float l, float a, float b) { checkWriter(); state.colorDetails = writer.addSimple(lab); PageResources prs = getPageResources(); PdfName name = state.colorDetails.getColorSpaceName(); name = prs.addColor(name, state.colorDetails.getIndirectReference()); saveColor(new LabColor(lab, l, a, b), true); content.append(name.getBytes()).append(" CS "); content.append(l + " " + a + " " + b + " "); content.append("SCN").append_i(separator); }
public void showTextGid(final String gids) { checkState(); if (!inText && isTagged()) { beginText(true); } if (state.fontDetails == null) throw new NullPointerException(MessageLocalization.getComposedMessage("font.and.size.must.be.set.before.writing.any.text")); Object[] objs = state.fontDetails.convertToBytesGid(gids); StringUtils.escapeString((byte[]) objs[0], content); state.tx += ((Integer)objs[2]).intValue() * 0.001f * state.size; content.append("Tj").append_i(separator); }
/** * Ends a marked content sequence */ public void endMarkedContentSequence() { if (getMcDepth() == 0) { throw new IllegalPdfSyntaxException(MessageLocalization.getComposedMessage("unbalanced.begin.end.marked.content.operators")); } int contentSize = content.size(); setMcDepth(getMcDepth() - 1); content.append("EMC").append_i(separator); markedContentSize += content.size() - contentSize; }