-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Checkmarks are not shown in Print Preview and are not printed in pdf #12233
Comments
Hmm, this looks like it has something to do with that particular PDF, using https://www.irs.gov/pub/irs-pdf/f1040.pdf the checkmarks are saved both in print preview and printed to pdf |
I have found the cause and am working on a fix. The problem is that the value given to |
The choice widgets in this PDF file are problematic. I have identified two issues in the choice widgets code:
|
…ption selection The export value is used when the document is saved, so it should also be used when the document is opened to determine which choice widget option is selected. The display value is, as the name implies, only to be used for viewer display purposes and not for other logic. This makes sure that in the document from mozilla#12233 the "Favourite colour" choice widget is correctly initialized with "Red" instead of "Black" because the field value is equal to the export value (always the case), but not the display value (not always the case). Moreover, saving now also correctly uses the export value and not the display value.
The down appearance (`D`) is optional and not available in the document from mozilla#12233, so the checkboxes are never saved/printed as checked because the checked appearance is based on the export value that is missing because the `D` entry is not available. Instead, we should use the normal appearance (`N`) since that one is required and therefore always available.
In addition to the unit tests these reference tests make sure that this document, that triggered some edge cases in our code, can be rendered and printed successfully now.
The down appearance (`D`) is optional and not available in the document from mozilla#12233, so the checkboxes are never saved/printed as checked because the checked appearance is based on the export value that is missing because the `D` entry is not available. Instead, we should use the normal appearance (`N`) since that one is required and therefore always available. Finally, the off appearance is optional according to section 12.7.4.2.3 of the specification, so that needs to be taken into account to match the specification and to fix reference test failures for the `annotation-button-widget-print` test. That is a file that doesn't specify an off appearance in the normal appearance dictionary.
In addition to the unit tests these reference tests make sure that this document, that triggered some edge cases in our code, can be rendered and printed successfully now.
The down appearance (`D`) is optional and not available in the document from mozilla#12233, so the checkboxes are never saved/printed as checked because the checked appearance is based on the export value that is missing because the `D` entry is not available. Instead, we should use the normal appearance (`N`) since that one is required and therefore always available. Finally, the /Off appearance is optional according to section 12.7.4.2.3 of the specification, so that needs to be taken into account to match the specification and to fix reference test failures for the `annotation-button-widget-print` test. That is a file that doesn't specify an /Off appearance in the normal appearance dictionary.
In addition to the unit tests these reference tests make sure that this document, that triggered some edge cases in our code, can be rendered and printed successfully now.
When printing the pdf in mozilla#12233 in Acrobat, we can see that the combo for country is empty: it's because the V entry doesn't have to be one of the options.
When printing the pdf in mozilla#12233 in Acrobat, we can see that the combo for country is empty: it's because the V entry doesn't have to be one of the options.
Affected versions
Affected platforms
Steps to reproduce
pdfjs.renderInteractiveForms - true
Expected result
Actual result
Additional notes
The text was updated successfully, but these errors were encountered: