|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.xpn.xwiki.pdf.impl.PdfExportImpl
public class PdfExportImpl
Default implementation for the PDF Export process, which uses XSLT transformations and Apache FOP to convert a Document into PDF, passing through HTML, valid XHTML, styled XHTML, and XSL-FO.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.xpn.xwiki.pdf.api.PdfExport |
---|
PdfExport.ExportType |
Constructor Summary | |
---|---|
PdfExportImpl()
|
Method Summary | |
---|---|
protected String |
applyXSLT(String xml,
InputStream xslt)
Applies an XSLT transformation to an XML document. |
void |
export(XWikiDocument doc,
OutputStream out,
PdfExport.ExportType type,
XWikiContext context)
Export a wiki Document into PDF or RTF. |
void |
exportHtml(String html,
OutputStream out,
PdfExport.ExportType type,
XWikiContext context)
Convert an HTML document to PDF. |
void |
exportToPDF(XWikiDocument doc,
OutputStream out,
XWikiContext context)
Export a wiki Document into PDF. |
protected void |
exportXHTML(String xhtml,
OutputStream out,
PdfExport.ExportType type,
XWikiContext context)
Convert a valid XHTML document into PDF. |
protected InputStream |
getXslt(String propertyName,
String fallbackFile,
XWikiContext context)
Get an XSLT file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PdfExportImpl()
Method Detail |
---|
public void exportToPDF(XWikiDocument doc, OutputStream out, XWikiContext context) throws XWikiException
PdfExport
PdfExport.export(XWikiDocument, OutputStream, ExportType, XWikiContext)
for more details about the
conversion process.
exportToPDF
in interface PdfExport
doc
- the document to exportout
- where to write the resulting documentcontext
- the current request context
XWikiException
- if the conversion fails for any reasonPdfExport.export(XWikiDocument, OutputStream, ExportType, XWikiContext)
public void export(XWikiDocument doc, OutputStream out, PdfExport.ExportType type, XWikiContext context) throws XWikiException
PdfExport
pdf.vm
template, the resulting HTML is cleaned up into valid XHTML, and custom CSS is applied to it. The
XHTML document is transformed into an XSL-FO document, which is finally processed using Apache FOP.
export
in interface PdfExport
doc
- the document to exportout
- where to write the resulting documenttype
- the type of the output: PDF or RTFcontext
- the current request context
XWikiException
- if the conversion fails for any reasonpublic void exportHtml(String html, OutputStream out, PdfExport.ExportType type, XWikiContext context) throws XWikiException
PdfExport
exportHtml
in interface PdfExport
html
- the source document to transformout
- where to write the resulting documenttype
- the type of the output: PDF or RTFcontext
- the current request context
XWikiException
- if the conversion fails for any reasonprotected void exportXHTML(String xhtml, OutputStream out, PdfExport.ExportType type, XWikiContext context) throws XWikiException
Note: This method is protected just allow other exporters to hook their code and use the PDF export infrastructure. This is just a temporary solution. The PDF export code needs to be redesigned because it has parts than can be reused for other export formats.
xhtml
- the source document to transformout
- where to write the resulting documenttype
- the type of the output: PDF or RTFcontext
- the current request context
XWikiException
- if the conversion fails for any reasonprotected String applyXSLT(String xml, InputStream xslt) throws XWikiException
xml
- the XML document to convertxslt
- the XSLT to apply
XWikiException
- if the transformation fails for any reasonprotected InputStream getXslt(String propertyName, String fallbackFile, XWikiContext context)
propertyName
- the name of the XWiki.PDFClass property to read from the current PDFTemplate
documentfallbackFile
- the name of a resource file to use when the PDFTemplate does not contain an overridecontext
- the current request context
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |