/** * @since 2.1.6 private is now protected */ protected void saveAndRotateCanvases(PdfContentByte[] canvases, float a, float b, float c, float d, float e, float f) { int last = PdfPTable.TEXTCANVAS + 1; if (canvasesPos == null) canvasesPos = new int[last * 2]; for (int k = 0; k < last; ++k) { ByteBuffer bb = canvases[k].getInternalBuffer(); canvasesPos[k * 2] = bb.size(); canvases[k].saveState(); canvases[k].concatCTM(a, b, c, d, e, f); canvasesPos[k * 2 + 1] = bb.size(); } }
/** * @since 2.1.6 private is now protected */ protected void saveAndRotateCanvases(PdfContentByte[] canvases, float a, float b, float c, float d, float e, float f) { int last = PdfPTable.TEXTCANVAS + 1; if (canvasesPos == null) canvasesPos = new int[last * 2]; for (int k = 0; k < last; ++k) { ByteBuffer bb = canvases[k].getInternalBuffer(); canvasesPos[k * 2] = bb.size(); canvases[k].saveState(); canvases[k].concatCTM(a, b, c, d, e, f); canvasesPos[k * 2 + 1] = bb.size(); } }
/** * @since 2.1.6 private is now protected */ protected void saveAndRotateCanvases(PdfContentByte[] canvases, float a, float b, float c, float d, float e, float f) { int last = PdfPTable.TEXTCANVAS + 1; if (canvasesPos == null) canvasesPos = new int[last * 2]; for (int k = 0; k < last; ++k) { ByteBuffer bb = canvases[k].getInternalBuffer(); canvasesPos[k * 2] = bb.size(); canvases[k].saveState(); canvases[k].concatCTM(a, b, c, d, e, f); canvasesPos[k * 2 + 1] = bb.size(); } }
public void manipulatePdf(String src, String dest) throws IOException, DocumentException { PdfReader reader = new PdfReader(src); PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(dest)); AffineTransform transform = AffineTransform.getRotateInstance(Math.PI / 6); stamper.getWriter().setPageEvent(new AddAnnotation(stamper, transform)); PdfContentByte canvas = stamper.getOverContent(1); Font bold = new Font(FontFamily.HELVETICA, 12, Font.BOLD); Chunk chunk = new Chunk("The Best iText Questions on StackOverflow", bold); chunk.setGenericTag("http://pages.itextpdf.com/ebook-stackoverflow-questions.html"); Phrase p = new Phrase("Download "); p.add(chunk); p.add(" and discover more than 200 questions and answers."); canvas.saveState(); canvas.concatCTM(transform); ColumnText ct = new ColumnText(canvas); ct.setSimpleColumn(300, 0, 800, 400); ct.addText(p); ct.go(); canvas.restoreState(); stamper.close(); reader.close(); }
public void manipulatePdf(String src, String dest) throws IOException, DocumentException { PdfReader reader = new PdfReader(src); PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(dest)); AffineTransform transform = AffineTransform.getRotateInstance(Math.PI / 2); stamper.getWriter().setPageEvent(new AddAnnotation(stamper, transform)); PdfContentByte canvas = stamper.getOverContent(1); Font bold = new Font(FontFamily.HELVETICA, 12, Font.BOLD); Chunk chunk = new Chunk("The Best iText Questions on StackOverflow", bold); chunk.setGenericTag("http://pages.itextpdf.com/ebook-stackoverflow-questions.html"); Phrase p = new Phrase("Download "); p.add(chunk); p.add(" and discover more than 200 questions and answers."); canvas.saveState(); canvas.concatCTM(transform); ColumnText ct = new ColumnText(canvas); ct.setSimpleColumn(36, -559, 806, -36); ct.addText(p); ct.go(); canvas.restoreState(); stamper.close(); reader.close(); }
float cos = (float)Math.cos(alpha); float sin = (float)Math.sin(alpha); canvas.concatCTM(cos, sin, -sin, cos, x, y);
float cos = (float)Math.cos(alpha); float sin = (float)Math.sin(alpha); canvas.concatCTM(cos, sin, -sin, cos, x, y);
float cos = (float)Math.cos(alpha); float sin = (float)Math.sin(alpha); canvas.concatCTM(cos, sin, -sin, cos, x, y);
float ury = bf.getFontDescriptor(BaseFont.BBOXURY, fontSize); cb.saveState(); cb.concatCTM(cos, sin, -sin, cos, refX, refY); if ((align & MetaState.TA_CENTER) == MetaState.TA_CENTER) tx = -textWidth / 2;
float ury = bf.getFontDescriptor(BaseFont.BBOXURY, fontSize); cb.saveState(); cb.concatCTM(cos, sin, -sin, cos, refX, refY); if ((align & MetaState.TA_CENTER) == MetaState.TA_CENTER) tx = -textWidth / 2;
float ury = bf.getFontDescriptor(BaseFont.BBOXURY, fontSize); cb.saveState(); cb.concatCTM(cos, sin, -sin, cos, refX, refY); if ((align & MetaState.TA_CENTER) == MetaState.TA_CENTER) tx = -textWidth / 2;
cb.restoreState(); cb.saveState(); cb.concatCTM(1, 0, 0, 1, eanR.getWidth() + n, eanR.getHeight() - ean.getBarHeight()); supp.placeBarcode(cb, barColor, textColor); cb.restoreState();
cb.restoreState(); cb.saveState(); cb.concatCTM(1, 0, 0, 1, eanR.getWidth() + n, eanR.getHeight() - ean.getBarHeight()); supp.placeBarcode(cb, barColor, textColor); cb.restoreState();
cb.restoreState(); cb.saveState(); cb.concatCTM(1, 0, 0, 1, eanR.getWidth() + n, eanR.getHeight() - ean.getBarHeight()); supp.placeBarcode(cb, barColor, textColor); cb.restoreState();
float w = image.getWidth(); float h = image.getHeight(); concatCTM(a / w, b / w, c / h, d / h, e, f); rectangle(image); restoreState();
float w = image.getWidth(); float h = image.getHeight(); concatCTM(a / w, b / w, c / h, d / h, e, f); rectangle(image); restoreState();
float w = image.getWidth(); float h = image.getHeight(); concatCTM(a / w, b / w, c / h, d / h, e, f); rectangle(image); restoreState();