XFA - Fix indentation for justified paragraph
- and ceil the reserve for a caption to avoid to split it; - both issues are present in the pdf in issue #13633.
This commit is contained in:
parent
d80651e572
commit
9b5574d3ef
@ -445,12 +445,10 @@ function fixTextIndent(styles) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If indent is negative then it's a hanging indent.
|
// If indent is negative then it's a hanging indent.
|
||||||
const align = styles.textAlign || "left";
|
const align = styles.textAlign === "right" ? "right" : "left";
|
||||||
if (align === "left" || align === "right") {
|
|
||||||
const name = "padding" + (align === "left" ? "Left" : "Right");
|
const name = "padding" + (align === "left" ? "Left" : "Right");
|
||||||
const padding = getMeasurement(styles[name], "0px");
|
const padding = getMeasurement(styles[name], "0px");
|
||||||
styles[name] = `${padding - indent}px`;
|
styles[name] = `${padding - indent}px`;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setAccess(node, classNames) {
|
function setAccess(node, classNames) {
|
||||||
|
@ -897,7 +897,7 @@ class Caption extends XFAObject {
|
|||||||
"inactive",
|
"inactive",
|
||||||
"invisible",
|
"invisible",
|
||||||
]);
|
]);
|
||||||
this.reserve = getMeasurement(attributes.reserve);
|
this.reserve = Math.ceil(getMeasurement(attributes.reserve));
|
||||||
this.use = attributes.use || "";
|
this.use = attributes.use || "";
|
||||||
this.usehref = attributes.usehref || "";
|
this.usehref = attributes.usehref || "";
|
||||||
this.extras = null;
|
this.extras = null;
|
||||||
|
1
test/pdfs/xfa_issue13633.pdf.link
Normal file
1
test/pdfs/xfa_issue13633.pdf.link
Normal file
@ -0,0 +1 @@
|
|||||||
|
https://web.archive.org/web/20210703155102/https://www.jobcenter-remscheid.de/files/jobcenter-remscheid/download/anzeige-kug101_ba013134.pdf
|
@ -1106,6 +1106,14 @@
|
|||||||
"enableXfa": true,
|
"enableXfa": true,
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
},
|
},
|
||||||
|
{ "id": "xfa_issue13633",
|
||||||
|
"file": "pdfs/xfa_issue13633.pdf",
|
||||||
|
"md5": "e5b0d09285ca6a140eba08d740be0ea0",
|
||||||
|
"link": true,
|
||||||
|
"rounds": 1,
|
||||||
|
"enableXfa": true,
|
||||||
|
"type": "eq"
|
||||||
|
},
|
||||||
{ "id": "xfa_issue13631",
|
{ "id": "xfa_issue13631",
|
||||||
"file": "pdfs/xfa_issue13631.pdf",
|
"file": "pdfs/xfa_issue13631.pdf",
|
||||||
"md5": "bf24397950dc8b8fcb7e91299af1315a",
|
"md5": "bf24397950dc8b8fcb7e91299af1315a",
|
||||||
|
Loading…
Reference in New Issue
Block a user