-
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
Add a default DA for textfield to avoid issues when printing or saving #12751
Conversation
calixteman
commented
Dec 18, 2020
- it aims to fix issue Invalid DA avoids to save or print #12750
src/core/annotation.js
Outdated
@@ -1282,6 +1285,15 @@ class WidgetAnnotation extends Annotation { | |||
const totalHeight = this.data.rect[3] - this.data.rect[1]; | |||
const totalWidth = this.data.rect[2] - this.data.rect[0]; | |||
|
|||
if (!this.data.defaultAppearance) { | |||
// The DA is required and must be a string. | |||
// There is no reason to have a font named Helvetica in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not? The PDF file might just have a font named Helvetica
in the dictionary. I think this whole sentence should be rephrased to: If there is no font named Helvetica in the resource dictionary, the evaluator will fall back to a default font. Doing so prevents exceptions and allows saving/printing the file as expected.
src/core/annotation.js
Outdated
// the resource dictionary so the evaluator will fallback on | ||
// a default one: it isn't ideal but at least it prevents from | ||
// exceptions and it allows to save or print the file as expected. | ||
this.data.defaultAppearance = "/Helvetica 10 Tf 0 g"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at https://stackoverflow.com/questions/17503349/da-pdfbox-how-to-create, would using 0 perhaps make sense here so it's auto-scaled?
* it aims to fix issue mozilla#12750
2fea11e
to
a7c682c
Compare
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://54.67.70.0:8877/c41eedfb26e4c86/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://3.101.106.178:8877/921d5a45390a0ba/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/c41eedfb26e4c86/output.txt Total script time: 25.87 mins
Image differences available at: http://54.67.70.0:8877/c41eedfb26e4c86/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://3.101.106.178:8877/921d5a45390a0ba/output.txt Total script time: 27.26 mins
Image differences available at: http://3.101.106.178:8877/921d5a45390a0ba/reftest-analyzer.html#web=eq.log |
/botio makeref |
From: Bot.io (Linux m4)ReceivedCommand cmd_makeref from @brendandahl received. Current queue size: 0 Live output at: http://54.67.70.0:8877/88963064a7990b2/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @brendandahl received. Current queue size: 0 Live output at: http://3.101.106.178:8877/4872df379bd437e/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/88963064a7990b2/output.txt Total script time: 24.54 mins
|
From: Bot.io (Windows)SuccessFull output at http://3.101.106.178:8877/4872df379bd437e/output.txt Total script time: 25.74 mins
|