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 Ink annotations #15047

Merged
merged 1 commit into from
Jun 21, 2022

Conversation

calixteman
Copy link
Contributor

No description provided.

@calixteman calixteman requested a review from Snuffleupagus June 15, 2022 14:58
@marco-c marco-c linked an issue Jun 15, 2022 that may be closed by this pull request
@calixteman
Copy link
Contributor Author

@Snuffleupagus would you have time to have a look on this patch ?

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 and passing tests; thank you!


Sorry about the delay, this one slipped my mind given the amount of recent PRs and the fact that my time isn't unlimited :-)

@@ -294,6 +294,27 @@ class AnnotationFactory {
dependencies,
};
}

static async createNewAnnotationForPrinting(evaluator, task, annotations) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

The method just above is called saveNewAnnotations, hence the following (and shorter) name seems more appropriate here:

Suggested change
static async createNewAnnotationForPrinting(evaluator, task, annotations) {
static async printNewAnnotations(evaluator, task, annotations) {

@@ -3509,6 +3546,16 @@ class InkAnnotation extends MarkupAnnotation {

results.push({ ref: inkRef, data: buffer.join("") });
}

static async createAnnotationForPrinting(annotation, xref) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similar to existing naming, how about:

Suggested change
static async createAnnotationForPrinting(annotation, xref) {
static async createNewPrintAnnotation(annotation, xref) {

@@ -548,6 +549,27 @@ function numberToString(value) {
return value.toFixed(2);
}

function getNewlyAddedAnnotations(annotationStorage) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd prefer the following instead, since it tells you what sort of data is returned (and it's slightly shorter):

Suggested change
function getNewlyAddedAnnotations(annotationStorage) {
function getNewAnnotationsMap(annotationStorage) {

Comment on lines 448 to 450
]).then(function ([pageOpList, annotations, newParsedAnnotations]) {
if (Array.isArray(newParsedAnnotations)) {
annotations = annotations.concat(newParsedAnnotations);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe slightly shorter names (again), and the isArray-check might be overkill (since it's either null or an Array):

Suggested change
]).then(function ([pageOpList, annotations, newParsedAnnotations]) {
if (Array.isArray(newParsedAnnotations)) {
annotations = annotations.concat(newParsedAnnotations);
]).then(function ([pageOpList, annotations, newAnnotations]) {
if (newAnnotations) {
annotations = annotations.concat(newAnnotations);

@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: 1

Live output at: http://54.241.84.105:8877/ea895476e2873f3/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

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

web/app_options.js Outdated Show resolved Hide resolved
@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/ea895476e2873f3/output.txt

Total script time: 26.19 mins

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

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

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

Total script time: 28.28 mins

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

@calixteman calixteman merged commit c7a18bd into mozilla:master Jun 21, 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: 1

Live output at: http://54.241.84.105:8877/eaefba805b682d3/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/1a72311e884deb1/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/eaefba805b682d3/output.txt

Total script time: 22.86 mins

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/1a72311e884deb1/output.txt

Total script time: 22.13 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