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

Displaying PDF ‘readonly’ text fields in Java

43 sec read

This article follows on from previous blog What are PDF ‘readonly’ text fields?

In that article I  introduced ReadOnly text fields and explained that ‘ReadOnly Text Fields within a PDF are not truly read only. This article expands on some issues and explains how our PDF Viewer handles these quirks and makes use of the features on readonly text fields?

Firstly, we have setup our Javascript to be able to change the underlying value for each field. We need to allow for the possibility that all fields can become readonly.

JPedal makes the textfields readonly by using JButtons to display them. This also allows us to use our superior PDF font engine to display the form as close as possible to the way Adobe Acrobat does.

The problems comes when the value gets changed, as now the Appearance Object associated to the form is no longer valid.

This requires some careful manipulation of the image display stream so that the text still appears as close as we can get it to Adobe Acrobat.

So the fact that ReadOnly text field are not totally readonly introduces a number of issues which have to be carefully worked around. Have you encountered any problems like this?

Did you know...

IDRsolutions offers a whole range of online file converters to convert PDF and Microsoft Excel, Word and Office Documents to HTML5, SVG or image formats?

It is free to use for single file conversions and also includes Developer links if you want to use our commercial software for bulk conversions. Find out more on this page

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.