mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-24 09:08:07 +02:00
[Annotation] Don't rotate an annotation when it has the NoRotate flag
This commit is contained in:
parent
652a6df62b
commit
3849063d36
6 changed files with 105 additions and 36 deletions
|
@ -19,7 +19,7 @@
|
|||
position: absolute;
|
||||
}
|
||||
|
||||
.annotationLayer .buttonWidgetAnnotation.pushButton > img {
|
||||
.annotationLayer .wasCanvas {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
|
|
|
@ -135,6 +135,7 @@ async function convertCanvasesToImages(annotationCanvasMap, outputScale) {
|
|||
new Promise(resolve => {
|
||||
canvas.toBlob(blob => {
|
||||
const image = document.createElement("img");
|
||||
image.classList.add("wasCanvas");
|
||||
image.onload = function () {
|
||||
image.style.width = Math.floor(image.width / outputScale) + "px";
|
||||
resolve();
|
||||
|
@ -625,6 +626,9 @@ class Driver {
|
|||
let viewport = page.getViewport({
|
||||
scale: PixelsPerInch.PDF_TO_CSS_UNITS,
|
||||
});
|
||||
if (task.rotation) {
|
||||
viewport = viewport.clone({ rotation: task.rotation });
|
||||
}
|
||||
// Restrict the test from creating a canvas that is too big.
|
||||
const MAX_CANVAS_PIXEL_DIMENSION = 4096;
|
||||
const largestDimension = Math.max(viewport.width, viewport.height);
|
||||
|
|
|
@ -7394,5 +7394,32 @@
|
|||
"rounds": 1,
|
||||
"link": true,
|
||||
"type": "eq"
|
||||
},
|
||||
{
|
||||
"id": "annotation-link-text-popup-rotated-90",
|
||||
"file": "pdfs/annotation-link-text-popup.pdf",
|
||||
"md5": "4bbf56e81d47232de5f305124ab0ba27",
|
||||
"rounds": 1,
|
||||
"type": "eq",
|
||||
"annotations": true,
|
||||
"rotation": 90
|
||||
},
|
||||
{
|
||||
"id": "annotation-link-text-popup-rotated-180",
|
||||
"file": "pdfs/annotation-link-text-popup.pdf",
|
||||
"md5": "4bbf56e81d47232de5f305124ab0ba27",
|
||||
"rounds": 1,
|
||||
"type": "eq",
|
||||
"annotations": true,
|
||||
"rotation": 180
|
||||
},
|
||||
{
|
||||
"id": "annotation-link-text-popup-rotated-270",
|
||||
"file": "pdfs/annotation-link-text-popup.pdf",
|
||||
"md5": "4bbf56e81d47232de5f305124ab0ba27",
|
||||
"rounds": 1,
|
||||
"type": "eq",
|
||||
"annotations": true,
|
||||
"rotation": 270
|
||||
}
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue