Skip to content
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

Merged
merged 1 commit into from
Dec 21, 2020

Conversation

calixteman
Copy link
Contributor

@@ -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
Copy link
Contributor

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.

// 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";
Copy link
Contributor

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?

@brendandahl
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_test from @brendandahl received. Current queue size: 0

Live output at: http://54.67.70.0:8877/c41eedfb26e4c86/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @brendandahl received. Current queue size: 0

Live output at: http://3.101.106.178:8877/921d5a45390a0ba/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/c41eedfb26e4c86/output.txt

Total script time: 25.87 mins

  • Font tests: Passed
  • Unit tests: FAILED
  • Integration Tests: Passed
  • Regression tests: FAILED

Image differences available at: http://54.67.70.0:8877/c41eedfb26e4c86/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://3.101.106.178:8877/921d5a45390a0ba/output.txt

Total script time: 27.26 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED

Image differences available at: http://3.101.106.178:8877/921d5a45390a0ba/reftest-analyzer.html#web=eq.log

@brendandahl
Copy link
Contributor

/botio makeref

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_makeref from @brendandahl received. Current queue size: 0

Live output at: http://54.67.70.0:8877/88963064a7990b2/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_makeref from @brendandahl received. Current queue size: 0

Live output at: http://3.101.106.178:8877/4872df379bd437e/output.txt

@brendandahl brendandahl merged commit 3ea1c43 into mozilla:master Dec 21, 2020
@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/88963064a7990b2/output.txt

Total script time: 24.54 mins

  • Lint: Passed
  • Make references: Passed
  • Check references: Passed

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://3.101.106.178:8877/4872df379bd437e/output.txt

Total script time: 25.74 mins

  • Lint: Passed
  • Make references: Passed
  • Check references: Passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants