public class XFAFlattener extends Object implements com.itextpdf.tool.xml.html.CssAppliersAware
Input for flattening can be either PDF document containing XFA forms or XDP stream (a pure XML stream containing XFA description).
To flattenXDP the form (from either PDF or XDP):
XFAFlattener
instanceflattenXDP
methodModifier and Type | Class and Description |
---|---|
static class |
XFAFlattener.ViewMode |
Constructor and Description |
---|
XFAFlattener() |
Modifier and Type | Method and Description |
---|---|
void |
flatten(InputStream xfaInputStream, OutputStream pdfOutputStream)
Flattens XFA form from PDF
|
void |
flattenXDP(Document xdpData, OutputStream pdfOutputStream)
Flattens XFA form from XML data.
|
void |
flattenXDP(InputStream xdpStream, OutputStream pdfOutputStream)
Flattens XFA form from XDP stream.
|
AppConfig |
getAppConfig() |
com.itextpdf.tool.xml.html.CssAppliers |
getCssAppliers()
For internal use only.
|
Locale |
getDefaultLocale() |
List<String> |
getExtraEventList() |
XFAFlattenerProperties |
getFlattenerProperties() |
XFAFontSettings |
getFontSettings() |
HostConfig |
getHostConfig() |
com.itextpdf.tool.xml.xtra.xfa.resolver.IHrefResolver |
getHrefResolver() |
XFAFlattener.ViewMode |
getViewMode() |
XFAFlattener |
setAppConfig(AppConfig appConfig) |
void |
setCssAppliers(com.itextpdf.tool.xml.html.CssAppliers cssAppliers)
For internal use only.
|
XFAFlattener |
setDefaultLocale(Locale defaultLocale) |
XFAFlattener |
setExtraEventList(List<String> extraEventList) |
XFAFlattener |
setFlattenerProperties(XFAFlattenerProperties flattenerProperties) |
XFAFlattener |
setFontSettings(XFAFontSettings fontSettings) |
XFAFlattener |
setHostConfig(HostConfig hostConfig) |
XFAFlattener |
setHrefResolver(com.itextpdf.tool.xml.xtra.xfa.resolver.IHrefResolver hrefResolver) |
XFAFlattener |
setViewMode(XFAFlattener.ViewMode viewMode) |
public void flattenXDP(InputStream xdpStream, OutputStream pdfOutputStream) throws IOException
Example:
XFAFlattener flattener = new XFAFlattener();
FileInputStream fin = new FileInputStream("c:/xdp_source.xml");
flattener.flattenXDP(fin, new FileOutputStream("my_flat_doc.pdf"));
fin.close();
xdpStream
- an XDP stream
IOException
public void flatten(InputStream xfaInputStream, OutputStream pdfOutputStream) throws IOException, InterruptedException
xfaInputStream
- the input stream with the PDF containing XFA template
pdfOutputStream
- the output stream where the flattened PDF will be written to
IOException
InterruptedException
public void flattenXDP(Document xdpData, OutputStream pdfOutputStream) throws IOException
Example:
XFAFlattener flattener = new XFAFlattener();
File xmlFile = new File("c:/xdp_source.xml");
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
org.w3c.dom.Document xmlDoc = docBuilder.parse(fXmlFile);
flattener.flattenXDP(xmlDoc, new FileOutputStream("my_flat_doc.pdf"));
xdpData
- an XML data.
IOException
public void setCssAppliers(com.itextpdf.tool.xml.html.CssAppliers cssAppliers)
setCssAppliers
in interface com.itextpdf.tool.xml.html.CssAppliersAware
public com.itextpdf.tool.xml.html.CssAppliers getCssAppliers()
getCssAppliers
in interface com.itextpdf.tool.xml.html.CssAppliersAware
public XFAFlattener.ViewMode getViewMode()
public XFAFlattener setViewMode(XFAFlattener.ViewMode viewMode)
public AppConfig getAppConfig()
public XFAFlattener setAppConfig(AppConfig appConfig)
public HostConfig getHostConfig()
public XFAFlattener setHostConfig(HostConfig hostConfig)
public Locale getDefaultLocale()
public XFAFlattener setDefaultLocale(Locale defaultLocale)
public XFAFlattener setExtraEventList(List<String> extraEventList)
public com.itextpdf.tool.xml.xtra.xfa.resolver.IHrefResolver getHrefResolver()
public XFAFlattener setHrefResolver(com.itextpdf.tool.xml.xtra.xfa.resolver.IHrefResolver hrefResolver)
public XFAFontSettings getFontSettings()
public XFAFlattener setFontSettings(XFAFontSettings fontSettings)
public XFAFlattenerProperties getFlattenerProperties()
public XFAFlattener setFlattenerProperties(XFAFlattenerProperties flattenerProperties)
Copyright (C) 1998-2019 iText Group NV. All Rights Reserved.