Poppler: Add read only setter for form fields
ClosedPublic

Authored by aheinecke on Feb 26 2018, 2:27 PM.

Details

Summary

Read only is modifiable from AcroForm scripts. As such
we need to add setting it to the data model of Poppler.

I know that this is not the right place for a poppler patch but until we have discussed the rest of the series I think it makes sense to attach it to the task.

Test Plan

Manually tested and with a unit test that will be part of the task.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
aacid added a subscriber: aacid.Mar 15 2018, 4:37 PM

There is a problem with this, in which when saving, this doesn't get saved, because FormField::setReadonly is not updating Ff properly, so if you click on of the checkboxes and then save the file and open it again it looks wrong.

Do you think you can try fixing that?

I've started to look at saving this on Friday. I'm a bit confused as the ReadOnly is a Field value and not a Widget Annotation value and the Adobe Spec says that it is ignored for Widget Annotations.

Saving a document with Adobe after changing a ReadOnly field to a Read/Write seems to add a new Widget Annotation for the Field, though.

As I don't really have experience working with the PDF File Format / poppler internals I'm a bit out of my depths here. I'll spend some more hours trying to understand it better today.

aheinecke updated this revision to Diff 29917.Mar 19 2018, 2:10 PM

Added object dict / xref update so that the Read Only state is saved.

With this change saving / loading the read only state works.

aacid accepted this revision.Mar 20 2018, 10:23 PM

I've pushed this to poppler, please close.

This revision is now accepted and ready to land.Mar 20 2018, 10:23 PM