mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 09:38:06 +02:00
XFA -- Load fonts permanently from the pdf
- Different fonts can be used in xfa and some of them are embedded in the pdf. - Load all the fonts in window.document. Update src/core/document.js Co-authored-by: Jonas Jenwald <jonas.jenwald@gmail.com> Update src/core/worker.js Co-authored-by: Jonas Jenwald <jonas.jenwald@gmail.com>
This commit is contained in:
parent
6cf3070008
commit
7e9579045f
8 changed files with 318 additions and 21 deletions
|
@ -193,6 +193,17 @@ class WorkerMessageHandler {
|
|||
pdfManager.ensureDoc("fingerprint"),
|
||||
pdfManager.ensureDoc("isPureXfa"),
|
||||
]);
|
||||
|
||||
if (isPureXfa) {
|
||||
const task = new WorkerTask("Load fonts for Xfa");
|
||||
startWorkerTask(task);
|
||||
await pdfManager
|
||||
.loadXfaFonts(handler, task)
|
||||
.catch(reason => {
|
||||
// Ignore errors, to allow the document to load.
|
||||
})
|
||||
.then(() => finishWorkerTask(task));
|
||||
}
|
||||
return { numPages, fingerprint, isPureXfa };
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue