/** * Parses a given file. * @param document The document that will listen to the parser * @param is The InputStream with the contents */ public void go(DocListener document, InputSource is) { try { parser.parse(is, new SAXiTextHandler(document)); } catch(SAXException se) { throw new ExceptionConverter(se); } catch(IOException ioe) { throw new ExceptionConverter(ioe); } }
/** * Parses a given file. * @param document The document that will listen to the parser * @param is The inputsource with the content * @param tagmap A user defined tagmap */ public void go(DocListener document, InputSource is, String tagmap) { try { parser.parse(is, new SAXmyHandler(document, new TagMap(tagmap))); } catch(SAXException se) { throw new ExceptionConverter(se); } catch(IOException ioe) { throw new ExceptionConverter(ioe); } }
/** * Parses a given file. * @param document The document that will listen to the parser * @param is the inputsource with the content * @param tagmap an inputstream to a user defined tagmap */ public void go(DocListener document, InputSource is, InputStream tagmap) { try { parser.parse(is, new SAXmyHandler(document, new TagMap(tagmap))); } catch(SAXException se) { throw new ExceptionConverter(se); } catch(IOException ioe) { throw new ExceptionConverter(ioe); } }
/** * Parses a given file. * @param document The document that will listen to the parser * @param is the inputsource with the content * @param tagmap a user defined tagmap */ public void go(DocListener document, InputSource is, HashMap tagmap) { try { parser.parse(is, new SAXmyHandler(document, tagmap)); } catch(SAXException se) { throw new ExceptionConverter(se); } catch(IOException ioe) { throw new ExceptionConverter(ioe); } }
/** * Parses a given file. * @param document The document that will listen to the parser * @param file The path to a file with the content */ public void go(DocListener document, String file) { try { parser.parse(file, new SAXiTextHandler(document)); } catch(SAXException se) { throw new ExceptionConverter(se); } catch(IOException ioe) { throw new ExceptionConverter(ioe); } }
/** * Parses a given file. * @param document the document that will listen to the parser * @param file the path to a file with the content * @param tagmap a user defined tagmap */ public void go(DocListener document, String file, String tagmap) { try { parser.parse(file, new SAXmyHandler(document, new TagMap(tagmap))); } catch(SAXException se) { throw new ExceptionConverter(se); } catch(IOException ioe) { throw new ExceptionConverter(ioe); } }
/** * Parses a given file. * @param document The document that will listen to the parser * @param file the path to a file with the content * @param tagmap a user defined tagmap */ public void go(DocListener document, String file, HashMap tagmap) { try { parser.parse(file, new SAXmyHandler(document, tagmap)); } catch(SAXException se) { throw new ExceptionConverter(se); } catch(IOException ioe) { throw new ExceptionConverter(ioe); } }
/** * Use this method to get an instance of the <CODE>PdfWriter</CODE>. * * @return a new <CODE>PdfWriter</CODE> * @param document The <CODE>Document</CODE> that has to be written * @param os The <CODE>OutputStream</CODE> the writer has to write to. * @param listener A <CODE>DocListener</CODE> to pass to the PdfDocument. * @throws DocumentException on error */ public static PdfWriter getInstance(Document document, OutputStream os, DocListener listener) throws DocumentException { PdfDocument pdf = new PdfDocument(); pdf.addDocListener(listener); document.addDocListener(pdf); PdfWriter writer = new PdfWriter(pdf, os); pdf.addWriter(writer); return writer; }
/** * Parses a given file. * @param document the document the parser will write to * @param is the InputSource with the content */ public void go(DocListener document, InputSource is) { try { parser.parse(is, new SAXmyHtmlHandler(document)); } catch(SAXException se) { throw new ExceptionConverter(se); } catch(IOException ioe) { throw new ExceptionConverter(ioe); } }
/** * Parses a given file. * @param document the document the parser will write to * @param file the file with the content */ public void go(DocListener document, String file) { try { parser.parse(file, new SAXmyHtmlHandler(document)); } catch(SAXException se) { throw new ExceptionConverter(se); } catch(IOException ioe) { throw new ExceptionConverter(ioe); } }
/** * Parses a given file. * @param document the document the parser will write to * @param is the InputStream with the content */ public void go(DocListener document, InputStream is) { try { parser.parse(new InputSource(is), new SAXmyHtmlHandler(document)); } catch(SAXException se) { throw new ExceptionConverter(se); } catch(IOException ioe) { throw new ExceptionConverter(ioe); } }
/** * Parses a given file. * @param document the document the parser will write to * @param is the Reader with the content */ public void go(DocListener document, Reader is) { try { parser.parse(new InputSource(is), new SAXmyHtmlHandler(document)); } catch(SAXException se) { throw new ExceptionConverter(se); } catch(IOException ioe) { throw new ExceptionConverter(ioe); } }
/** Creates a new instance of HTMLWorker */ public HTMLWorker(DocListener document) { this.document = document; cprops = new ChainedProperties(); String fontName = ServerConfigurationService.getString("pdf.default.font"); if (StringUtils.isNotBlank(fontName)) { FontFactory.registerDirectories(); if (FontFactory.isRegistered(fontName)) { HashMap fontProps = new HashMap(); fontProps.put(ElementTags.FACE, fontName); fontProps.put("encoding", BaseFont.IDENTITY_H); cprops.addToChain("face", fontProps); } } }
/** Gets an instance of the <CODE>PdfWriter</CODE>. * * @return a new <CODE>PdfWriter</CODE> * @param document The <CODE>Document</CODE> that has to be written * @param os The <CODE>OutputStream</CODE> the writer has to write to. * @param listener A <CODE>DocListener</CODE> to pass to the PdfDocument. * @throws DocumentException on error */ public static PdfWriter getInstance(Document document, OutputStream os, DocListener listener) throws DocumentException { PdfDocument pdf = new PdfDocument(); pdf.addDocListener(listener); document.addDocListener(pdf); PdfWriter writer = new PdfWriter(pdf, os); pdf.addWriter(writer); return writer; }