Chris Wade Chris developed much of the Forms handling code and also the hooks for the XFA.

What are PDF ‘readonly’ text fields?

55 sec read

Once you start to explore the PDF file format you will find out something called ‘ReadOnly’ Text Fields. So what exactly are they and how can they be useful within a PDF?

PDF files contain text fields which allow you to enter text into. I am sure that is not a surprise and that they can be ReadOnly, so that a user cannot edit the text field.  Because they cannot be altered, they often include the details to display them as an image. This can be helpful in Java because that often means embedded fonts which can be used to generate an exact representation.

But are they really ‘readonly‘?

A user cannot directly edit a text field that is ReadOnly, but there is a way to alter the value of a ‘ReadOnly’ text field. Form fields can be updated not just by the user but also by Javascript within the PDF which is tied to an action. If there is an action within the PDF that sets the value of the ‘ReadOnly’ text field, thus altering the value of the text field and making ReadOnly rather more of a dynamic feature.

So a ‘ReadOnly’ text field is not truly Read Only.

Do you have any experience of these?

This post is part of our “Understanding the PDF File Format” series. In each article, we discuss a PDF feature, bug, gotcha or tip. If you wish to learn more about PDF, we have 13 years worth of PDF knowledge and tips, so click here to visit our series index!

IDRsolutions develop a Java PDF library, a PDF forms to HTML5 converter, a PDF to HTML5 or SVG converter and a Java Image Library that doubles as an ImageIO replacement. On the blog our team post about anything interesting they learn about.

Chris Wade Chris developed much of the Forms handling code and also the hooks for the XFA.

Enabling SVG Gzip Compression on Apache and NGINX

Gzip compression is a widely supported method of reducing the size of the content sent from a web server in order to improve the...
Leon Atherton
47 sec read

Leave a Reply

Your email address will not be published. Required fields are marked *

IDRsolutions Ltd 2020. All rights reserved.