|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xhtmlrenderer.pdf.DefaultPDFCreationListener
org.xhtmlrenderer.pdf.util.XHtmlMetaToPdfInfoAdapter
public class XHtmlMetaToPdfInfoAdapter
This PDF Creation Listener parses meta data elements from an (X)HTML document and appends them to the info dictionary of a PDF document.
The XHTML document is parsed for relevant PDF meta data during construction, then adds the meta data to the PDF document when the PDF document is closed by the calling ITextRenderer.
Valid (X)HTML tags are:
Valid (X)HTML meta tag attribute names are:
Valid PDF meta names are defined in Adobe's PDF Reference (Sixth Edition), section "10.2.1 - Document Information Dictionary", table 10.2, pg.844 http://www.adobe.com/devnet/pdf/pdf_reference.html
// Setup output stream
OutputStream outputStream = ...
// Create W3C document model
Document doc = ...
// Create new PDF renderer
ITextRenderer renderer = new ITextRenderer();
// Add PDF creation listener
PDFCreationListener pdfCreationListener = new XHtmlMetaToPdfInfoAdapter( doc );
renderer.setListener( pdfCreationListener);
// Add W3C document to renderer
renderer.setDocument( doc, null );
// Layout PDF document
renderer.layout();
// Write PDF document
renderer.createPDF( outputStream, true );
DefaultPDFCreationListener,
PDFCreationListener,
ITextRenderer,
http://markmail.org/message/46t3bw7q6mbhvra2,
http://www.adobe.com/devnet/pdf/pdf_reference.html,
http://www.seoconsultants.com/meta-tags/dublin/| Constructor Summary | |
|---|---|
XHtmlMetaToPdfInfoAdapter(org.w3c.dom.Document doc)
Creates a new adapter from the given XHTML document. |
|
| Method Summary | |
|---|---|
void |
onClose(ITextRenderer renderer)
PDFCreationListener onClose event handler. |
| Methods inherited from class org.xhtmlrenderer.pdf.DefaultPDFCreationListener |
|---|
preOpen, preWrite |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XHtmlMetaToPdfInfoAdapter(org.w3c.dom.Document doc)
doc - XHTML document| Method Detail |
|---|
public void onClose(ITextRenderer renderer)
onClose in interface PDFCreationListeneronClose in class DefaultPDFCreationListenerrenderer - the iTextRenderer preparing the documentPDFCreationListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||