Skip to main content
13-Aquamarine
February 2, 2024
Solved

PDF form field on title page

  • February 2, 2024
  • 2 replies
  • 1620 views

Hello,

I want to use PDF Form Field functionality (in ATX 8.2.2) on the Title Page of the book
(via page region with the Text Generated Content) but in vain.

 

PDF creation is aborted with Error message PDFlib Warnings:
create_field: Invalid field pathname 'textField_0' (name 'textField_0' already exists)

 

The PDF form fields usage inside xml document works correctly according manual: ATX_HOME\samples\APP\PDFFormFields.

 

Is it possible to use this functionality in the Page Layouts (by using Styler only, without editing in ALD) ?

 

Thanks for help

Jana

Best answer by jhubackova

Here is solution from PTC Support: 

https://www.ptc.com/en/support/article/CS413728

Cause:

  • Each frame/content stream has its own set of counters, each starting at zero
  • Using the same counter in different streams can therefore result in duplicate field names

Resolution:

  • Use a unique identifier for the field name, such as something based on the location path of the current XML node
//DO NOT USE 
//name: "textField_" + formatting.counters[101]++,

//USE
var fieldName =  "text_field_" +  application.calculateHash(formatting.currentXMLNode.getNodePath(1));
 
 

2 replies

13-Aquamarine
February 2, 2024

EDIT: or sometime the PDF publishing is finished without error but also WITHOUT Page Region where form field is used.

13-Aquamarine
February 2, 2024

EDIT 2 🙈:  Form Field of the type "Check Box" works correctly on the Title Page

jhubackova_0-1706882415844.png

 

jhubackova13-AquamarineAuthorAnswer
13-Aquamarine
March 22, 2024

Here is solution from PTC Support: 

https://www.ptc.com/en/support/article/CS413728

Cause:

  • Each frame/content stream has its own set of counters, each starting at zero
  • Using the same counter in different streams can therefore result in duplicate field names

Resolution:

  • Use a unique identifier for the field name, such as something based on the location path of the current XML node
//DO NOT USE 
//name: "textField_" + formatting.counters[101]++,

//USE
var fieldName =  "text_field_" +  application.calculateHash(formatting.currentXMLNode.getNodePath(1));