public class XFAFlattener extends Object implements com.itextpdf.tool.xml.html.CssAppliersAware
XFAFlattener
instanceflattenXDP
methodModifier and Type | Class and Description |
---|---|
static class |
XFAFlattener.ViewMode |
Constructor and Description |
---|
XFAFlattener() |
public void flattenXDP(InputStream xdpStream, OutputStream pdfOutputStream) throws IOException
com.itextpdf.text.Document document = new com.itextpdf.text.Document();
com.itextpdf.text.pdf.PdfWriter writer = com.itextpdf.text.pdf.PdfWriter.getInstance(document, new FileOutputStream("my_flat_doc.pdf"));
document.open();
XFAFlattener flattener = new XFAFlattener(document, writer);
FileInputStream fin = new FileInputStream("c:/xdp_source.xml"); flattener.flattenXDP(fin);
fin.close(); reader.close();
document.close();
xdpStream
- an XDP stream
IOException
public void flatten(InputStream xfaInputStream, OutputStream pdfOutputStream) throws IOException, InterruptedException
IOException
InterruptedException
public void flattenXDP(Document xdpData, OutputStream pdfOutputStream) throws IOException
com.itextpdf.text.Document document = new com.itextpdf.text.Document();
com.itextpdf.text.pdf.PdfWriter writer = com.itextpdf.text.pdf.PdfWriter.getInstance(document, new FileOutputStream("my_flat_doc.pdf"));
document.open();
XFAFlattener flattener = new XFAFlattener(document, writer);
FileInputStream fin = new FileInputStream("c:/xdp_source.xml");
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);
xmlDoc.close();
reader.close();
document.close();
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 IHrefResolver getHrefResolver()
public XFAFlattener setHrefResolver(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.