01.01.2015 Views

XML Forms Data Format (XFDF) Specification - Adobe Partners

XML Forms Data Format (XFDF) Specification - Adobe Partners

XML Forms Data Format (XFDF) Specification - Adobe Partners

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Introduction to <strong>XFDF</strong><br />

<strong>XML</strong> <strong>Forms</strong> <strong>Data</strong> <strong>Format</strong> <strong>Specification</strong> The border element 29<br />

transformation between the <strong>XML</strong> representation and the PDF representation is such that converting from<br />

PDF to <strong>XML</strong> then back to <strong>XML</strong> from PDF reproduces the original binary string.<br />

Encoding Examples<br />

PDF STRING<br />

Jump in the “Lake” <br />

abc123 nothing special here<br />

unusual \200\177\220\237 characters<br />

(Here, the \ddd represent an actual single<br />

byte character with code octal ddd)<br />

<strong>XML</strong> ATTR STRING<br />

attr=”Jump in the &quot;Lake&quot; &lt;Jake&gt;”<br />

attr=”abc123 nothing special here”<br />

attr=”unusual \200\177\220\237 characters”<br />

Enhancements<br />

Before assuming the encoding is ISO Latin-1, it is permissible to scan the string to determine if it uses<br />

UTF-8 encoding. If so, the translation described above can still be used, but the translation should be<br />

applied to the UTF-8 characters instead of individual bytes.<br />

The border element<br />

Legacy <strong>XFDF</strong> files with freetext annotations may contain a border element:<br />

<br />

...<br />

<br />

...<br />

<br />

When importing this <strong>XFDF</strong> annotation to a PDF file, the border element is mapped to both the Border<br />

and BS keys. On a round trip back to <strong>XFDF</strong>, this will be mapped to the width attribute of the freetext<br />

annotation element.<br />

Rich text strings<br />

Beginning with PDF 1.5, the text contents of variable text form fields and markup annotations can include<br />

formatting or style information. These rich text strings conform to a subset of the XFA Text <strong>Specification</strong>,<br />

which is itself a subset of the XHTML 1.0 specification, augmented with a restricted set of CSS2 style<br />

attributes. Rich text strings are fully described in the PDF Reference.<br />

For example, the following Text Field form has a value formatted as rich text.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!