GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Java/itext-java-html-pdf/src/main/java/com/hmkcode/App.java at master · jooeey/Java Expand file tree/ Copy pathApp.javaMore file actions 29 lines (26 loc) · 835 Bytes / Copy pathApp.javaFile metadata and controls29 lines (26 loc) · 835 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 package com.hmkcode; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import com.itextpdf.text.Document; import com.itextpdf.text.DocumentException; import com.itextpdf.text.pdf.PdfWriter; import com.itextpdf.tool.xml.XMLWorkerHelper; public class App { public static void main( String[] args ) throws DocumentException, IOException { // step 1 Document document = new Document(); // step 2 PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("pdf.pdf")); // step 3 document.open(); // step 4 XMLWorkerHelper.getInstance().parseXHtml(writer, document, new FileInputStream("index.html")); //step 5 document.close(); System.out.println( "PDF Created!" ); } } |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |