Skip to main content
zihanj15128920
Participant
September 12, 2023
Question

Exporting/importing data for form fields that contains CR/LF characters

  • September 12, 2023
  • 1 reply
  • 270 views

My job involves translating data from English into Chinese in some PDF forms, which involves exporting and (re)import in xfdf format. The process goes perfect, except for fields that have CR (carriage return) characters. The data for such fields are exported, but always fail to be imported back. This failure happens to the fdf format as well. Here are my findings and my workarounds:

 

In fdf, that character is rendered as \r, and you will have to manually change it to \n in order for the fdf to be imported back properly.

 

In xfdf, it is just the opposite - it is rendered as 
 and you will have to change it to 

 

The PDF document involved can be downloaded here. The problem fields are Nos. 4 & 7, which in the exported xfdf shows like:

<field name="Infrastructure Systems &#xA;"
>
and

><field name="Infrastructure Systems &#xA;"
>


Of course, in order for such filed name code to be included in the exported xfdf, you have to enter some content in these fields before exporting.

 

And the involvement of such non-printable character in the form field name looks like a mistake on the designer's side, but I have to bear with it. 8-(

 

But as Acrobat is concerned here, is this funny CR/LF conversion a bug, or a design?

 

This topic has been closed for replies.

1 reply

zihanj15128920
Participant
September 12, 2023

The code for the 2nd field name is actually:
<field name="Sustainable Design and Climate Resiliency&#xA;"
>
Sorry for the typo!