Package org.docx4j.samples
Class ConvertOutPDFviaXSLFO
java.lang.Object
org.docx4j.samples.ConvertOutPDFviaXSLFO
Demo of PDF output.
PDF output is via XSL FO.
First XSL FO is created, then FOP
is used to convert that to PDF.
Don't worry if you get a class not
found warning relating to batik. It
doesn't matter.
If you don't have logging configured,
your PDF will say "TO HIDE THESE MESSAGES,
TURN OFF debug level logging for
org.docx4j.convert.out.pdf.viaXSLFO". The thinking is
that you need to be able to be warned if there
are things in your docx which the PDF output
doesn't support...
docx4j used to also support creating
PDF via iText and via HTML. As of docx4j 2.5.0,
only viaXSLFO is supported. The viaIText and
viaHTML source code can be found in src/docx4j-extras directory
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidgetInputFilePath(String[] args) protected static voidgetOutputFilePath(String[] args) static void
-
Field Details
-
inputfilepath
-
outputfilepath
-
saveFO
static boolean saveFO
-
-
Constructor Details
-
ConvertOutPDFviaXSLFO
public ConvertOutPDFviaXSLFO()
-
-
Method Details
-
main
- Throws:
Exception
-
getInputFilePath
- Throws:
IllegalArgumentException
-
getOutputFilePath
- Throws:
IllegalArgumentException
-