Merge pull request #12230 from timvandermeij/reference-test-print
Implement reference testing for printing
This commit is contained in:
commit
b52b36f6a5
@ -519,7 +519,8 @@ var Driver = (function DriverClosure() {
|
|||||||
|
|
||||||
// Initialize various `eq` test subtypes, see comment below.
|
// Initialize various `eq` test subtypes, see comment below.
|
||||||
var renderAnnotations = false,
|
var renderAnnotations = false,
|
||||||
renderForms = false;
|
renderForms = false,
|
||||||
|
renderPrint = false;
|
||||||
|
|
||||||
var textLayerCanvas, annotationLayerCanvas;
|
var textLayerCanvas, annotationLayerCanvas;
|
||||||
var initPromise;
|
var initPromise;
|
||||||
@ -559,6 +560,7 @@ var Driver = (function DriverClosure() {
|
|||||||
// accidentally changing the behaviour for other types of tests.
|
// accidentally changing the behaviour for other types of tests.
|
||||||
renderAnnotations = !!task.annotations;
|
renderAnnotations = !!task.annotations;
|
||||||
renderForms = !!task.forms;
|
renderForms = !!task.forms;
|
||||||
|
renderPrint = !!task.print;
|
||||||
|
|
||||||
// Render the annotation layer if necessary.
|
// Render the annotation layer if necessary.
|
||||||
if (renderAnnotations || renderForms) {
|
if (renderAnnotations || renderForms) {
|
||||||
@ -604,6 +606,19 @@ var Driver = (function DriverClosure() {
|
|||||||
viewport,
|
viewport,
|
||||||
renderInteractiveForms: renderForms,
|
renderInteractiveForms: renderForms,
|
||||||
};
|
};
|
||||||
|
if (renderPrint) {
|
||||||
|
const annotationStorage = task.annotationStorage;
|
||||||
|
if (annotationStorage) {
|
||||||
|
const docAnnotationStorage = task.pdfDoc.annotationStorage;
|
||||||
|
const entries = Object.entries(annotationStorage);
|
||||||
|
for (const [key, value] of entries) {
|
||||||
|
docAnnotationStorage.setValue(key, value);
|
||||||
|
}
|
||||||
|
renderContext.annotationStorage = docAnnotationStorage;
|
||||||
|
}
|
||||||
|
renderContext.intent = "print";
|
||||||
|
}
|
||||||
|
|
||||||
var completeRender = function (error) {
|
var completeRender = function (error) {
|
||||||
// if text layer is present, compose it on top of the page
|
// if text layer is present, compose it on top of the page
|
||||||
if (textLayerCanvas) {
|
if (textLayerCanvas) {
|
||||||
|
@ -4448,6 +4448,22 @@
|
|||||||
"type": "eq",
|
"type": "eq",
|
||||||
"forms": true
|
"forms": true
|
||||||
},
|
},
|
||||||
|
{ "id": "annotation-text-widget-print",
|
||||||
|
"file": "pdfs/annotation-text-widget.pdf",
|
||||||
|
"md5": "b7b8923a12998fca8603fae53f73f19b",
|
||||||
|
"rounds": 1,
|
||||||
|
"type": "eq",
|
||||||
|
"print": true,
|
||||||
|
"annotationStorage": {
|
||||||
|
"61R": "Single line, unlimited length",
|
||||||
|
"62R": "Single lin",
|
||||||
|
"63R": "Single line, center aligned",
|
||||||
|
"64R": "Single line, right aligned",
|
||||||
|
"65R": "",
|
||||||
|
"66R": "zyxwvutsrqponmlkjihgfedcba",
|
||||||
|
"67R": "Multiline\nstring"
|
||||||
|
}
|
||||||
|
},
|
||||||
{ "id": "annotation-choice-widget-annotations",
|
{ "id": "annotation-choice-widget-annotations",
|
||||||
"file": "pdfs/annotation-choice-widget.pdf",
|
"file": "pdfs/annotation-choice-widget.pdf",
|
||||||
"md5": "7dfb0d743a0da0f4a71b209ab43b0be5",
|
"md5": "7dfb0d743a0da0f4a71b209ab43b0be5",
|
||||||
@ -4462,6 +4478,20 @@
|
|||||||
"type": "eq",
|
"type": "eq",
|
||||||
"forms": true
|
"forms": true
|
||||||
},
|
},
|
||||||
|
{ "id": "annotation-choice-widget-print",
|
||||||
|
"file": "pdfs/annotation-choice-widget.pdf",
|
||||||
|
"md5": "7dfb0d743a0da0f4a71b209ab43b0be5",
|
||||||
|
"rounds": 1,
|
||||||
|
"type": "eq",
|
||||||
|
"print": true,
|
||||||
|
"annotationStorage": {
|
||||||
|
"57R": "Ipsum",
|
||||||
|
"58R": "Lorem",
|
||||||
|
"59R": "Dolor",
|
||||||
|
"62R": "Sit",
|
||||||
|
"63R": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
{ "id": "issue11931",
|
{ "id": "issue11931",
|
||||||
"file": "pdfs/issue11931.pdf",
|
"file": "pdfs/issue11931.pdf",
|
||||||
"md5": "9ea233037992e1f10280420a49e72845",
|
"md5": "9ea233037992e1f10280420a49e72845",
|
||||||
@ -4488,6 +4518,24 @@
|
|||||||
"type": "eq",
|
"type": "eq",
|
||||||
"forms": true
|
"forms": true
|
||||||
},
|
},
|
||||||
|
{ "id": "annotation-button-widget-print",
|
||||||
|
"file": "pdfs/annotation-button-widget.pdf",
|
||||||
|
"md5": "5cf23adfff84256d9cfe261bea96dade",
|
||||||
|
"rounds": 1,
|
||||||
|
"type": "eq",
|
||||||
|
"print": true,
|
||||||
|
"annotationStorage": {
|
||||||
|
"105R": true,
|
||||||
|
"106R": false,
|
||||||
|
"107R": false,
|
||||||
|
"108R": true,
|
||||||
|
"109R": false,
|
||||||
|
"110R": false,
|
||||||
|
"111R": true,
|
||||||
|
"112R": false,
|
||||||
|
"113R": false
|
||||||
|
}
|
||||||
|
},
|
||||||
{ "id": "annotation-polyline-polygon",
|
{ "id": "annotation-polyline-polygon",
|
||||||
"file": "pdfs/annotation-polyline-polygon.pdf",
|
"file": "pdfs/annotation-polyline-polygon.pdf",
|
||||||
"md5": "e68611602f58c8ca70cc40575ba3b04e",
|
"md5": "e68611602f58c8ca70cc40575ba3b04e",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user