/** * Changes the currentgray tint for filling paths (device dependent colors!). * <P> * Sets the color space to <B>DeviceGray</B> (or the <B>DefaultGray</B> color space), * and sets the gray tint to use for filling paths.</P> * * @param gray a value between 0 (black) and 1 (white) */ public void setGrayFill(float gray) { content.append(gray).append(" g").append_i(separator); }
/** Outputs a <CODE>String</CODE> directly to the content. * @param s the <CODE>String</CODE> */ public void setLiteral(String s) { content.append(s); }
/** * Appends a Bêzier curve to the path, starting from the current point. * * @param x1 x-coordinate of the first control point * @param y1 y-coordinate of the first control point * @param x3 x-coordinate of the ending point (= new current point) * @param y3 y-coordinate of the ending point (= new current point) */ public void curveFromTo(float x1, float y1, float x3, float y3) { content.append(x1).append(' ').append(y1).append(' ').append(x3).append(' ').append(y3).append(" y").append_i(separator); }
/** * 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); }
/** * Fills the path, using the even-odd rule to determine the region to fill and strokes it. */ public void eoFillStroke() { content.append("B*").append_i(separator); }
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 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 currentgray tint for filling paths (device dependent colors!). * <P> * Sets the color space to <B>DeviceGray</B> (or the <B>DefaultGray</B> color space), * and sets the gray tint to use for filling paths.</P> * * @param gray a value between 0 (black) and 1 (white) */ public void setGrayFill(float gray) { content.append(gray).append(" g").append_i(separator); }
/** * Appends the string representation of an <CODE>int</CODE>. * @param i the <CODE>int</CODE> to be appended * @return a reference to this <CODE>ByteBuffer</CODE> object */ public ByteBuffer append(int i) { return append((double)i); }
/** * Appends a Bêzier curve to the path, starting from the current point. * * @param x1 x-coordinate of the first control point * @param y1 y-coordinate of the first control point * @param x3 x-coordinate of the ending point (= new current point) * @param y3 y-coordinate of the ending point (= new current point) */ public void curveFromTo(float x1, float y1, float x3, float y3) { content.append(x1).append(' ').append(y1).append(' ').append(x3).append(' ').append(y3).append(" y").append_i(separator); }
/** Outputs a <CODE>String</CODE> directly to the content. * @param s the <CODE>String</CODE> */ public void setLiteral(String s) { content.append(s); }
/** * Ends the path without filling or stroking it. */ public void newPath() { content.append("n").append_i(separator); }
/** Outputs a <CODE>char</CODE> directly to the content. * @param c the <CODE>char</CODE> */ public void setLiteral(char c) { content.append(c); }
/** * Closes the path, fills it using the non-zero winding number rule to determine the region to fill and strokes it. */ public void closePathFillStroke() { content.append("b").append_i(separator); }
/** * Moves to the start of the next line. */ public void newlineText() { state.yTLM -= state.leading; content.append("T*").append_i(separator); }
/** * Shows the <CODE>text</CODE>. * * @param text the text to write */ public void showText(String text) { showText2(text); content.append("Tj").append_i(separator); }
/** * Saves the graphic state. <CODE>saveState</CODE> and * <CODE>restoreState</CODE> must be balanced. */ public void saveState() { content.append("q").append_i(separator); stateList.add(new GraphicState(state)); }
/** * Ends the writing of text and makes the current font invalid. */ public void endText() { if (!inText) { throw new IllegalPdfSyntaxException(MessageLocalization.getComposedMessage("unbalanced.begin.end.text.operators")); } inText = false; content.append("ET").append_i(separator); }
/** Sets the graphic state * @param gstate the graphic state */ public void setGState(PdfGState gstate) { PdfObject[] obj = writer.addSimpleExtGState(gstate); PageResources prs = getPageResources(); PdfName name = prs.addExtGState((PdfName)obj[0], (PdfIndirectReference)obj[1]); content.append(name.getBytes()).append(" gs").append_i(separator); }