How to Exclude Hidden PDF Form Fields When Exporting Data to Excel
Question details
The user needs to prevent hidden PDF form fields from being included when exporting form data to an Excel spreadsheet.

- Product
- PDF Editor
- Device & OS
- not provided
- Scenario
- Exporting filled PDF form data to an Excel file for data analysis or record keeping.
- Observed behavior
- Hidden fields are automatically included in the exported data, creating unnecessary columns in the spreadsheet, and there is no native 'do not export' property available in standard PDF editors.
Make a note of the exact internal field names of the specific form fields you want to export, as you will need to reference them in your custom script.
Use a Custom JavaScript Export Action
Since there is no built-in property to exclude fields, creating a custom JavaScript action allows you to define an array of exactly which fields to export.
Advanced PDF editors like Adobe Acrobat do not have a native 'do not export' checkbox in the field properties. To bypass this limitation, you can use JavaScript to extract and export only the specific fields you need.
Open your PDF form in your advanced PDF editor and navigate to the 'Prepare Form' or 'Tools' section to access the document JavaScript editor.
Create a new script that defines an array containing only the exact field names you want to extract. For example: var fieldsToExport = ['FirstName', 'LastName', 'Email'];
Use your PDF software's API method (such as this.exportAsText or this.exportAsXFDF) to trigger the export, passing your selected fields array as a parameter so hidden fields are ignored.
Run the script to generate the structured text or XML file, then open or import this newly created file into Microsoft Excel or WPS Spreadsheet.

Export All Data and Clean Up in Excel
If you are not comfortable using JavaScript, export all data normally and manually remove the unwanted columns in your spreadsheet application.
Manage PDF Forms and Export to Excel with WPS Office
WPS Office provides robust PDF tools that make it easy to view, fill out, and manage PDF forms. Its powerful PDF to Excel conversion feature can intelligently extract visible data without the need for complex JavaScript coding.
- 1. Open PDF in WPS: Launch WPS Office and open your filled PDF form using the WPS PDF tool.
- 2. Select PDF to Excel: Navigate to the 'Tools' tab on the top ribbon and select 'PDF to Excel' from the conversion options.
- 3. Customize Conversion: Choose your conversion settings. WPS PDF will automatically extract the visible layout and form data into spreadsheet rows.
- 4. Clean Up Data: The converted file will open immediately in WPS Spreadsheet, allowing you to quickly delete or hide any columns you don't need.

Frequently Asked Questions
Is there a 'do not export' property for PDF form fields?
No, standard PDF editors generally do not offer a native property or checkbox to explicitly mark a form field as 'do not export'. Workarounds like JavaScript arrays or post-export spreadsheet cleanup are required.
Can I hide fields in Excel after exporting all PDF data?
Yes. A simpler alternative to writing custom JavaScript is to export all form data to an Excel or CSV file, then manually hide or delete the columns containing the hidden field data directly within your spreadsheet software.
What formats can I use to export PDF form data?
Common formats for exporting PDF form data include FDF (Forms Data Format), XFDF (XML-based FDF), CSV (Comma Separated Values), and simple TXT format, which can then be parsed by Excel.




