/** * Moves to the start of the next line. * * @return current canvas. */ public PdfCanvas newlineText() { contentStream.getOutputStream() .writeBytes(TStar); return this; }
/** * Fills current path. * * @return current canvas. */ public PdfCanvas fill() { contentStream.getOutputStream().writeBytes(f); return this; }
/** * 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. * * @return current canvas. */ public PdfCanvas eoClip() { contentStream.getOutputStream().writeBytes(WStar); return this; }
/** * Fills the path, using the even-odd rule to determine the region to fill and strokes it. * * @return current canvas. */ public PdfCanvas eoFillStroke() { contentStream.getOutputStream().writeBytes(BStar); return this; }
/** * Begins text block (PDF BT operator). * * @return current canvas. */ public PdfCanvas beginText() { contentStream.getOutputStream().writeBytes(BT); return this; }
/** * Closes the current subpath by appending a straight line segment from the current point * to the starting point of the subpath. * * @return current canvas. */ public PdfCanvas closePath() { contentStream.getOutputStream().writeBytes(h); return this; }
/** * EOFills current path. * * @return current canvas. */ public PdfCanvas eoFill() { contentStream.getOutputStream().writeBytes(fStar); return this; }
/** * Closes the path, fills it using the even-odd rule to determine the region to fill and strokes it. * * @return current canvas. */ public PdfCanvas closePathEoFillStroke() { contentStream.getOutputStream().writeBytes(bStar); return this; }
/** * Closes the path, fills it using the non-zero winding number rule to determine the region to fill and strokes it. * * @return current canvas. */ public PdfCanvas closePathFillStroke() { contentStream.getOutputStream().writeBytes(b); return this; }
/** * Strokes the path. * * @return current canvas. */ public PdfCanvas stroke() { contentStream.getOutputStream().writeBytes(S); return this; }
/** * Closes the path and strokes it. * * @return current canvas. */ public PdfCanvas closePathStroke() { contentStream.getOutputStream().writeBytes(s); return this; }
/** * Fills the path using the non-zero winding number rule to determine the region to fill and strokes it. * * @return current canvas. */ public PdfCanvas fillStroke() { contentStream.getOutputStream().writeBytes(B); return this; }
/** * Shows text (operator Tj). * * @param text text to show. * @return current canvas. */ public PdfCanvas showText(String text) { showTextInt(text); contentStream.getOutputStream().writeBytes(Tj); return this; }
/** * Manually end a Marked Content sequence. Used primarily for Tagged PDF * * @return current canvas */ public PdfCanvas endMarkedContent() { if (--mcDepth < 0) throw new PdfException(PdfException.UnbalancedBeginEndMarkedContentOperators); contentStream.getOutputStream().writeBytes(EMC); return this; }
private void write(PdfLiteral literal) { literal.setPosition(getCurrentPos()); writeBytes(literal.getInternalContent()); }
private static void drawPdfAAppearanceString(PdfCanvas canvas, float width, float height, float moveX, float moveY, String appearanceString) { canvas.saveState(); canvas.resetFillColorRgb(); canvas.concatMatrix(width, 0, 0, height, moveX, moveY); canvas.getContentStream().getOutputStream().writeBytes(appearanceString.getBytes(StandardCharsets.ISO_8859_1)); canvas.restoreState(); }
private void write(PdfNumber pdfNumber) { if (pdfNumber.hasContent()) { writeBytes(pdfNumber.getInternalContent()); } else if (pdfNumber.isDoubleNumber()) { writeDouble(pdfNumber.getValue()); } else { writeInteger(pdfNumber.intValue()); } }
private void addToPropertiesAndBeginLayer(IPdfOCG layer) { PdfName name = resources.addProperties(layer.getPdfObject()); contentStream.getOutputStream().write(PdfName.OC).writeSpace() .write(name).writeSpace().writeBytes(BDC).writeNewLine(); }
private PdfCanvas addImage(PdfXObject xObject, float a, float b, float c, float d, float e, float f) { saveState(); concatMatrix(a, b, c, d, e, f); PdfName name = resources.addImage(xObject.getPdfObject()); contentStream.getOutputStream().write(name).writeSpace().writeBytes(Do); restoreState(); return this; }
/** * Creates form XObject from page content. * The page shall be from the document, to which FormXObject will be added. * * @param page an instance of {@link PdfPage} */ public PdfFormXObject(PdfPage page) { this(page.getCropBox()); getPdfObject().getOutputStream().writeBytes(page.getContentBytes()); resources = new PdfResources((PdfDictionary) page.getResources().getPdfObject().clone()); getPdfObject().put(PdfName.Resources, resources.getPdfObject()); }