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

[Editor] Add support for printing newly added FreeText annotations #15082

Merged
merged 1 commit into from
Jun 22, 2022

Conversation

calixteman
Copy link
Contributor

No description provided.

Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me, with comments addressed; thank you!

static async createNewAppearanceStream(
annotation,
xref,
/* params */ _unused
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about simply leaving it as follows, since defining a different but likewise unused variable here seems unnecessary?

Suggested change
/* params */ _unused
params

const ap = await this.createNewAppearanceStream(annotation, xref, params);
const annotationDict = this.createNewDict(annotation, xref, { ap });

return new this.prototype.constructor({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's an interesting, and clever, way to avoid duplicating code!

@@ -79,6 +79,7 @@ class XRefMock {
this._map = Object.create(null);
this.stats = new DocStats({ send: () => {} });
this._newRefNum = null;
this.stream = { isDataLoaded: true };
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What change(s) made this necessary?

Also, please let's avoid any future issues by providing a "valid" BaseStream-instance here:

Suggested change
this.stream = { isDataLoaded: true };
this.stream = new NullStream();

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the test:
https://github.com/mozilla/pdf.js/pull/15082/files#diff-63129533f0fcab1395066c5eecb394e84cc3538b5e016a2f0bb49942825610e6R4088
we have to load the resources:

return objectLoader.load().then(function () {

and the isDataLoaded is used:
if (this.xref.stream.isDataLoaded) {

@marco-c marco-c linked an issue Jun 22, 2022 that may be closed by this pull request
@calixteman
Copy link
Contributor Author

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.241.84.105:8877/5b7c5c83a12c861/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/38fdb4335b5fb63/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/5b7c5c83a12c861/output.txt

Total script time: 26.35 mins

  • Font tests: Passed
  • Unit tests: FAILED
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 25
  different first/second rendering: 1

Image differences available at: http://54.241.84.105:8877/5b7c5c83a12c861/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/38fdb4335b5fb63/output.txt

Total script time: 28.40 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: FAILED
  different ref/snapshot: 1

Image differences available at: http://54.193.163.58:8877/38fdb4335b5fb63/reftest-analyzer.html#web=eq.log

@calixteman calixteman merged commit c5dc082 into mozilla:master Jun 22, 2022
@calixteman
Copy link
Contributor Author

/botio makeref

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.241.84.105:8877/11263bafac365c4/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/ca0716bf15c5597/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/ca0716bf15c5597/output.txt

Total script time: 22.07 mins

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

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/11263bafac365c4/output.txt

Total script time: 22.61 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
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support printing newly added content
3 participants