Skip to content
  • PDF Tools
    • Adobe® PDF Library
    • PDF SDKs
      • Adobe PDF Converter
      • Forms Extension
    • Specialized Utilities
      • PDF Checker
      • PDF Optimizer
      • FLIP2PDF
      • Forms Flattener
      • PDF2IMG
      • PDF2PRINT
      • Adobe Experience Reader Extensions
    • Adobe® InDesign Server
  • Developers
    • Support
    • Documentation
    • GitHub
    • Docker
    • NuGet
  • Solutions
    • Flatten Transparencies
    • Merge
    • Text Extraction
    • Watermark
    • Converting PDFs to PDF/A
    • Compression
    • Redactions
    • Extract Images
    • Text Search
  • Resources
    • Articles
    • Videos
  • Pricing
Menu
  • PDF Tools
    • Adobe® PDF Library
    • PDF SDKs
      • Adobe PDF Converter
      • Forms Extension
    • Specialized Utilities
      • PDF Checker
      • PDF Optimizer
      • FLIP2PDF
      • Forms Flattener
      • PDF2IMG
      • PDF2PRINT
      • Adobe Experience Reader Extensions
    • Adobe® InDesign Server
  • Developers
    • Support
    • Documentation
    • GitHub
    • Docker
    • NuGet
  • Solutions
    • Flatten Transparencies
    • Merge
    • Text Extraction
    • Watermark
    • Converting PDFs to PDF/A
    • Compression
    • Redactions
    • Extract Images
    • Text Search
  • Resources
    • Articles
    • Videos
  • Pricing
  • PDF Tools
    • Adobe® PDF Library
    • PDF SDKs
      • Adobe PDF Converter
      • Forms Extension
    • Specialized Utilities
      • PDF Checker
      • PDF Optimizer
      • FLIP2PDF
      • Forms Flattener
      • PDF2IMG
      • PDF2PRINT
      • Adobe Experience Reader Extensions
    • Adobe® InDesign Server
  • Developers
    • Support
    • Documentation
    • GitHub
    • Docker
    • NuGet
  • Solutions
    • Flatten Transparencies
    • Merge
    • Text Extraction
    • Watermark
    • Converting PDFs to PDF/A
    • Compression
    • Redactions
    • Extract Images
    • Text Search
  • Resources
    • Articles
    • Videos
  • Pricing

Cracking the Code: Managing PDF Forms

  • Datalogics Inc
  • February 10, 2023

Do you ever struggle with any of these PDF forms challenges?

  • Trouble opening, editing, accessing, or printing PDF form documents.
  • Struggling to import and export information from your PDF form.
  • PDF viewer software causing PDF form incompatibility issues and loss of features.
  • Inefficient paper-forms processing slows down important workflows.

PDF forms are not always the easiest to work with, but fortunately we have forms management tools available within the Adobe PDF Library’s Forms Extension module that can help you employ powerful forms technology in your own applications and beyond. Let’s take a look at our forms code samples to demonstrate how the underlying technology works. 

Note: The samples in this post are written in C++, but we have other samples available for .NET Framework and Java.

Converting XFA to AcroForm

XFA was deprecated in the new PDF 2.0 format and cannot be used with special ISO formats for PDF documents (such as PDF/A). Google Chrome and most other browsers will not display XFA documents, and XFA is not supported on mobile devices.The XFA format is being phased out, and the standard for managing forms within PDF files in the future will be AcroForms. If you are going to be building or manipulating PDF forms documents programmatically in the future, knowing to rely on AcroForms rather than XFA is important.

ConvertXFAToAcroForms is a code sample that demonstrates how to convert XFA (Dynamic or Static) fields to AcroForms fields and remove XFA fields.

pdf forms code sample

Importing & Exporting Forms Data 

Importing and exporting data from forms can be helpful when you need to view the data in the context of a PDF as opposed to other files types, or if you need to condense the data from a form and export it to use with different file formats.

In some cases, you may encounter completed forms as data-only files instead of full PDF files. These files use a different file format than PDFs, such as FDF, XML, or CSV. By viewing the original file and importing the data in the file, you can view the data submitted by a specific recipient in the context of the PDF.

Additionally, an exported file is usually smaller than the original PDF form file, which makes it much more convenient for distributing to others.

The ImportFormsData sample demonstrates how to Import forms data into XFA and AcroForms documents.

The ExportFormsData sample demonstrates how to Export forms data from XFA and AcroForms documents.

Forms Flattening 

Widespread challenges in forms processing workflows can prevent many users from opening and viewing the content of documents on screen, editing documents, and printing to paper.

Most XFA documents, for example, are completely unintelligible to the majority of PDF software and simply can’t be processed at all. By flattening XFA and AcroForms, you can solve this problem by removing editable form fields that users can interact with and replace them with baked-in textual content which will no longer be editable when viewing them with PDF software. 

The FlattenForms sample demonstrates how to Flatten two types of forms fields:

  • Flatten XFA (Dynamic or Static) to regular page content which converts and expands XFA fields to regular PDF content and removes the XFA fields. 
  • Flatten AcroForms to regular page content which converts AcroForm fields to regular page content and removes the AcroForm fields.

We invite you to check out the Datalogics GitHub Repository for more information on Adobe PDF Library and samples for the creation, modification and management of PDF documents.

Share this post with your friends

Latest Updates from Datalogics

PDF Tips

How PDF Forms with Barcodes Improve Efficiency in Education Fields

Read More »
September 10, 2022
Adobe PDF Library

Powerful PDF Searching with DocTextFinder in APDFL

Read More »
August 31, 2022
Company News

Results Prove PDF Optimizer Maximizes Compression and Downsizes Competition

Read More »
July 28, 2022
PDF Solutions

Maximum PDF Compression with Minimal Effort

Read More »
August 20, 2022
Load More

PDF SDKs

  • Adobe PDF Library
  • GitHub
  • PDF Converter
  • Forms Extension
  • callas Tools
  • Adobe PDF Print Engine
  • Java Toolkit

Specialized Utilities

  • PDF Optimizer
  • PDF Checker
  • FLIP2PDF
  • PDF2IMG
  • Docker
  • PDF2PRINT
  • PDF Forms Flattener
  • Adobe Experience Reader Extensions

inDesign Server

Developers

  • Contact Support
  • Documentation
  • GitHub
  • Docker
  • NuGet

Solutions

  • Compress PDF Files
  • Converting PDFs to PDF/A
  • Flatten Transparencies
  • Merge PDFs
  • Redaction in PDFs
  • Text Extraction in PDFs
  • Text Search PDF
  • Extract Images from PDFs
  • Watermark PDFs

Resources

  • Education & Articles

Pricing & Licensing

Company

  • About Us
  • EULA
  • Terms & Conditions
  • Privacy Policy
  • Cookie Policy

Contact Us

Contact Support for:

  • Adobe Content Server
  • Adobe Reader Mobile SDK
  • DL Composer
  • PDF Alchemist
Linkedin Twitter Facebook-f Youtube Github