![]() ![]() It's not my intention to make a complete list of products that use iText. ICEbrowser parses and lays out advanced Web content (XML/HTML/CSS/JS) PDF is generated by rendering the parsed documents to the PdfGraphics2D object. If you choose to generate PDF, iText's PdfGraphics2D object is used behind the scenes. JasperReports, a free Java reporting tool from JasperSoft, allows you to deliver content onto the screen to the printer or into PDF, HTML, XLS, CSV, and XML files.Let me pick two examples one free/open source software (FOSS) product and one proprietary product: Numerous applications use iText this way. Ta.getUI().getRootView(ta).paint(g2, alloc) Rectangle alloc = getVisibleEditorRect(ta) 95f) ĪffineTransform at = new AffineTransform() Īt.translate(convertToPixels(20), convertToPixels(20)) Graphics2D g2 = cb.createGraphics(612, 792, mapper, true. This example performs an affine transformation before the content of the JTextPane is painted: /* chapter12/JTextPaneToPdf.java */ The code is a bit more complex than the JTable example. Click on thumbnail to view full-sized image. A simple editor with a JTextPane that is drawn onto a PDF file. ![]() It's a simple text editor that allows you to write text in a JTextPane and print it to PDF.įigure 2 shows this application in action. ![]() The next example was posted to the iText mailing list by Bill Ensley (), one of the more experienced iText users on the mailing list. PdfTemplate tp = cb.createTemplate(500, 500) PdfContentByte cb = writer.getDirectContent() New FileOutputStream("my_jtable_fonts.pdf")) New FileOutputStream("my_jtable_shapes.pdf")) The code to achieve this is amazingly simple: /* chapter12/MyJTable.java */ If you select a row, the background of the row is shown in a different color in the Java applications as well as in the PDF. If you run this example, try changing the content of the JTable the changes are reflected in the PDF. A Swing application with a JTable that is printed to PDF two different ways. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |