From 677332aa7be426822fc63ada5bb518fc2f35dd67 Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Sun, 27 Jun 2021 18:05:05 +0200 Subject: [PATCH] XFA - Remove quotes of font name in xhtml --- src/core/xfa/xhtml.js | 4 ++-- test/pdfs/xfa_issue13631.pdf.link | 1 + test/test_manifest.json | 8 ++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 test/pdfs/xfa_issue13631.pdf.link diff --git a/src/core/xfa/xhtml.js b/src/core/xfa/xhtml.js index 3f6fbde87..753fa11da 100644 --- a/src/core/xfa/xhtml.js +++ b/src/core/xfa/xhtml.js @@ -29,7 +29,7 @@ import { } from "./xfa_object.js"; import { $buildXFAObject, NamespaceIds } from "./namespaces.js"; import { fixTextIndent, measureToString, setFontFamily } from "./html_utils.js"; -import { getMeasurement, HTMLResult } from "./utils.js"; +import { getMeasurement, HTMLResult, stripQuotes } from "./utils.js"; const XHTML_NS_ID = NamespaceIds.xhtml.id; @@ -191,7 +191,7 @@ class XhtmlObject extends XmlObject { continue; } if (key === "font-family") { - xfaFont.typeface = value; + xfaFont.typeface = stripQuotes(value); } else if (key === "font-size") { xfaFont.size = getMeasurement(value); } else if (key === "font-weight") { diff --git a/test/pdfs/xfa_issue13631.pdf.link b/test/pdfs/xfa_issue13631.pdf.link new file mode 100644 index 000000000..4da63ab54 --- /dev/null +++ b/test/pdfs/xfa_issue13631.pdf.link @@ -0,0 +1 @@ +https://web.archive.org/web/20210627155758/https://www.co.lucas.oh.us/DocumentCenter/View/44843/WIBApplicationForm diff --git a/test/test_manifest.json b/test/test_manifest.json index 97e6d2ff3..fd8190169 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -1026,6 +1026,14 @@ "enableXfa": true, "type": "eq" }, + { "id": "xfa_issue13631", + "file": "pdfs/xfa_issue13631.pdf", + "md5": "bf24397950dc8b8fcb7e91299af1315a", + "link": true, + "rounds": 1, + "enableXfa": true, + "type": "eq" + }, { "id": "xfa_issue13556", "file": "pdfs/xfa_issue13556.pdf", "md5": "197e93a010763c3b6f9845595ee66c70",