Coggle requires JavaScript to display documents.
PdfDocument pdf = new PdfDocument(new PdfWriter(dest)); PageSize ps = PageSize.A4.rotate(); PdfPage page = pdf.addNewPage(ps); PdfCanvas canvas = new PdfCanvas(page); // Draw the axes pdf.close();
canvas.concatMatrix(1, 0, 0, 1, ps.getWidth() / 2, ps.getHeight() / 2);
a b 0 c d 0 e f 1
PdfLinkAnnotation annotation = new PdfLinkAnnotation(new Rectangle(0, 0)) .setAction(PdfAction.createURI("https://itextpdf.com/")); Link link = new Link("here", annotation); Paragraph p = new Paragraph("The example of link annotation. Click ") .add(link.setUnderline()) .add(" to learn more..."); document.add(p);
PdfWriter writer = new PdfWriter(dest); PdfDocument pdf = new PdfDocument(writer); Document document = new Document(pdf); document.add(new Paragraph("Hello World!")); document.close();
pdf.addEventHandler(PdfDocumentEvent.END_PAGE, new MyEventHandler());