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!

Are you a Developer working with PDF files?

Our developers guide contains a large number of technical posts to help you understand the PDF file Format.

Find out more about our software for Developers

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

Leave a Reply

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

IDRsolutions Ltd 2021. All rights reserved.