1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 17:48:07 +02:00

XFA - Add Liberation-Sans font as a substitution for some missing fonts

- Some js files contain scale factors for each glyph in order to rescale Liberation to have a final font with the correct width.
  - A lot of XFA have some containers where their dimensions are based on their text content, so using default font from browser can lead to an almost unreadable pdf.
This commit is contained in:
Calixte Denizet 2021-06-08 20:50:31 +02:00
parent fd1110adb4
commit 34a2fa72c7
32 changed files with 1699 additions and 54 deletions

View file

@ -876,6 +876,12 @@ class PDFDocument {
return;
}
const options = Object.assign(
Object.create(null),
this.pdfManager.evaluatorOptions
);
options.useSystemFonts = false;
const partialEvaluator = new PartialEvaluator({
xref: this.xref,
handler,
@ -883,6 +889,7 @@ class PDFDocument {
idFactory: this._globalIdFactory,
fontCache: this.catalog.fontCache,
builtInCMapCache: this.catalog.builtInCMapCache,
options,
});
const operatorList = new OperatorList();
const initialState = {