XFA Flattener

No downloads or installation required!

Flatten an XFA-based PDF using our free online app, or learn how it works with our embedded iText 7 Sandbox (including the pdfXFA add-on).


Use the free online XFA Flattener app

Click the box to upload a XFA-based PDF, drag and drop a file into the box, or use the provided example file.

You will then be asked if you want to update the XFA data, or just flatten the XFA to a static PDF.

If you choose Update XFA Data you can edit the XML directly and download the updated unflattened XFA form. To view the updated XFA data you'll need to use a PDF viewer that supports XFA-based PDF forms.

Click Flatten XFA and then download the resulting static PDF file.

Or play in the iText 7 Sandbox

In this Sandbox you can see how the the XFA flattening code works in iText 7, and experiment with changing the code yourself.

Upload your own PDF containing an XFA form using Upload File and make sure the file name of the PDF you upload matches the name specified in private static final String ORIG.

import com.itextpdf.tool.xml.xtra.xfa.MetaData; import com.itextpdf.tool.xml.xtra.xfa.XFAFlattener; import com.itextpdf.tool.xml.xtra.xfa.XFAFlattenerProperties; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; public class PDFXfa { private static final String ORIG = "/uploads/input.pdf"; private static final String OUTPUT_FOLDER = "/myfiles/"; public static void main(String[] args) throws IOException, InterruptedException { XFAFlattenerProperties flattenerProperties = new XFAFlattenerProperties() .setPdfVersion(XFAFlattenerProperties.PDF_1_7) .createXmpMetaData() .setTagged() .setMetaData( new MetaData() .setAuthor("iText Samples") .setLanguage("EN") .setSubject("Showing off our flattening skills") .setTitle("Flattened XFA")); XFAFlattener xfaf = new XFAFlattener() .setFlattenerProperties(flattenerProperties); xfaf.flatten(new FileInputStream(ORIG), new FileOutputStream(OUTPUT_FOLDER + "flattened.pdf")); } }
using System; using System.IO; using iTextSharp.tool.xml.xtra.xfa; namespace PDFXfa { class Program { private static string ORIG = "/uploads/input.pdf"; private static string OUTPUT_FOLDER = "/myfiles/"; static void Main(string[] args) { XFAFlattenerProperties flattenerProperties = new XFAFlattenerProperties() .SetPdfVersion(XFAFlattenerProperties.PDF_1_7) .CreateXmpMetaData() .SetTagged() .SetMetaData( new MetaData() .SetAuthor("iText Samples") .SetLanguage("EN") .SetSubject("Showing off our flattening skills") .SetTitle("Flattened XFA")); XFAFlattener xfaf = new XFAFlattener() .SetFlattenerProperties(flattenerProperties); xfaf.Flatten(File.OpenRead(ORIG), new FileStream(OUTPUT_FOLDER + "flatteneded.pdf", FileMode.Create)); } } }
Disclaimer:

iText does not analyze the content of your uploaded or processed files. Users bear sole responsibility for the usage and content of their own files. All uploaded and processed files are deleted from our servers after users leave the page, or automatically after a period of 3 hours.



お問い合わせ

それでも問題が解決しませんか? 

お寄せいただいたご質問には、喜んでお答えいたします。当社へご連絡ください。内容を確認次第、追ってご連絡いたします。

問い合わせる
常に最新情報を得る

11,000人以上の購読者に加わって、iTextの新しい製品、アップデート、ヒント、記述的な解決策や出来事に関する最新情報を得ることでiText PDF専門家になりましょう。

今すぐ購読