/** * Appends a <CODE>char</CODE> to the buffer. The <CODE>char</CODE> is * converted according to the encoding ISO-8859-1. * @param c the <CODE>char</CODE> to be appended * @return a reference to this <CODE>ByteBuffer</CODE> object */ public ByteBuffer append(char c) { return append_i(c); }
/** * Changes the <VAR>line width</VAR>. * <P> * The line width specifies the thickness of the line used to stroke a path and is measured * in user space units.<BR> * * @param w a width */ public void setLineWidth(final double w) { content.append(w).append(" w").append_i(separator); }
/** * 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); }
/** * 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); }
/** * Changes the current color for stroking paths to black. * */ public void resetCMYKColorStroke() { saveColor(new CMYKColor(0, 0, 0, 1), false); content.append("0 0 0 1 K").append_i(separator); }
/** * Modify the current clipping path by intersecting it with the current path, using the * nonzero winding number rule to determine which regions lie inside the clipping * path. */ public void clip() { if (inText && isTagged()) { endText(); } content.append("W").append_i(separator); }
/** * Set the rendering intent, possible values are: PdfName.ABSOLUTECOLORIMETRIC, * PdfName.RELATIVECOLORIMETRIC, PdfName.SATURATION, PdfName.PERCEPTUAL. * @param ri */ public void setRenderingIntent(PdfName ri) { content.append(ri.getBytes()).append(" ri").append_i(separator); }
/** * 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); }
/** * Saves the graphic state. <CODE>saveState</CODE> and * <CODE>restoreState</CODE> must be balanced. */ public void saveState() { PdfWriter.checkPdfIsoConformance(writer, PdfIsoKeys.PDFISOKEY_CANVAS, "q"); if (inText && isTagged()) { endText(); } content.append("q").append_i(separator); stateList.add(new GraphicState(state)); }
/** * Sets the text rendering parameter. * * @param rendering a parameter */ public void setTextRenderingMode(final int rendering) { if (!inText && isTagged()) { beginText(true); } state.textRenderMode = rendering; content.append(rendering).append(" Tr").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); }
/** * Sets the word spacing parameter. * * @param wordSpace a parameter */ public void setWordSpacing(final float wordSpace) { if (!inText && isTagged()) { beginText(true); } state.wordSpace = wordSpace; content.append(wordSpace).append(" Tw").append_i(separator); }
/** * Sets the horizontal scaling parameter. * * @param scale a parameter */ public void setHorizontalScaling(final float scale) { if (!inText && isTagged()) { beginText(true); } state.scale = scale; content.append(scale).append(" Tz").append_i(separator); }
/** * Moves to the start of the next line. */ public void newlineText() { if (!inText && isTagged()) { beginText(true); } if (isTagged() && state.xTLM != state.tx) { setTextMatrix(state.aTLM, state.bTLM, state.cTLM, state.dTLM, state.xTLM, state.yTLM); } state.yTLM -= state.leading; content.append("T*").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; }
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 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); }
private void beginLayer2(final PdfOCG layer) { PdfName name = (PdfName)writer.addSimpleProperty(layer, layer.getRef())[0]; PageResources prs = getPageResources(); name = prs.addProperty(name, layer.getRef()); content.append("/OC ").append(name.getBytes()).append(" BDC").append_i(separator); }
/** * Paints using a shading object. * @param shading the shading object */ public void paintShading(final PdfShading shading) { writer.addSimpleShading(shading); PageResources prs = getPageResources(); PdfName name = prs.addShading(shading.getShadingName(), shading.getShadingReference()); content.append(name.getBytes()).append(" sh").append_i(separator); ColorDetails details = shading.getColorDetails(); if (details != null) prs.addColor(details.getColorSpaceName(), details.getIndirectReference()); }