You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The vast majority of PDF documents display fine. But there is a small part of the documents (I can’t post them, this is prohibited by the employer’s policy) looks like this:
"To view the full contents of this document, you need a later version of the PDF viewer. You can upgrade to the latest version of Adobe Reader from ..."
Moreover, after rendering there is always 1 page, although there are more pages in the document.
If you add enableXfa: true
in pdfjsLib.getDocument, then the number of pages in the document is already correct, but the document is empty, and the following message is displayed in the browser console:
Warning: XFA - Cannot find the font: Times New Roman
util.js:370 Warning: XFA - Cannot find the font: Myriad Pro
util.js:370 Warning: XFA - Cannot find the font: Arial
util.js:370 Warning: Font "Myriad Pro-Regular" is not available -- attempting to fallback to a default font.
util.js:370 Warning: Font "Myriad Pro-Bold" is not available -- attempting to fallback to a default font.
util.js:370 Warning: Font "Myriad Pro-Italic" is not available -- attempting to fallback to a default font.
util.js:370 Warning: Font "Myriad Pro-BoldItalic" is not available -- attempting to fallback to a default font.
util.js:370 Warning: Font "Arial-Regular" is not available -- attempting to fallback to a default font.
util.js:370 Warning: Font "Arial-Bold" is not available -- attempting to fallback to a default font.
util.js:370 Warning: Font "Arial-Italic" is not available -- attempting to fallback to a default font.
util.js:370 Warning: Font "Arial-BoldItalic" is not available -- attempting to fallback to a default font.
util.js:370 Warning: Font "PdfJS-Fallback-Regular" is not available -- attempting to fallback to a default font.
util.js:370 Warning: Font "PdfJS-Fallback-Bold" is not available -- attempting to fallback to a default font.
util.js:370 Warning: Font "PdfJS-Fallback-Italic" is not available -- attempting to fallback to a default font.
util.js:370 Warning: Font "PdfJS-Fallback-BoldItalic" is not available -- attempting to fallback to a default font.
util.js:370 Warning: fetchStandardFontData: failed to fetch file "LiberationSans-Regular.ttf" with "UnknownErrorException: The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.".
util.js:370 Warning: fetchStandardFontData: failed to fetch file "LiberationSans-Bold.ttf" with "UnknownErrorException: The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.".
util.js:370 Warning: fetchStandardFontData: failed to fetch file "LiberationSans-Italic.ttf" with "UnknownErrorException: The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.".
Warning: fetchStandardFontData: failed to fetch file "LiberationSans-BoldItalic.ttf" with "UnknownErrorException: The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.".
util.js:370 Warning: fetchStandardFontData: failed to fetch file "LiberationSans-Regular.ttf" with "UnknownErrorException: The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.".
util.js:370 Warning: fetchStandardFontData: failed to fetch file "LiberationSans-Bold.ttf" with "UnknownErrorException: The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.".
util.js:370 Warning: fetchStandardFontData: failed to fetch file "LiberationSans-Italic.ttf" with "UnknownErrorException: The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.".
util.js:370 Warning: fetchStandardFontData: failed to fetch file "LiberationSans-BoldItalic.ttf" with "UnknownErrorException: The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.".
util.js:370 Warning: fetchStandardFontData: failed to fetch file "LiberationSans-Regular.ttf" with "UnknownErrorException: The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.".
util.js:370 Warning: fetchStandardFontData: failed to fetch file "LiberationSans-Bold.ttf" with "UnknownErrorException: The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.".
util.js:370 Warning: fetchStandardFontData: failed to fetch file "LiberationSans-Italic.ttf" with "UnknownErrorException: The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.".
util.js:370 Warning: fetchStandardFontData: failed to fetch file "LiberationSans-BoldItalic.ttf" with "UnknownErrorException: The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.".
I add
standardFontDataUrl: "http://localhost:2329/Scripts/plugins/pdf.js/standard_fonts/"
in pdfjsLib.getDocument, The document is still empty, the number of pages is correct, but there are fewer warnings in the browser console:
Warning: XFA - Cannot find the font: Times New Roman
util.js:370 Warning: XFA - Cannot find the font: Myriad Pro
util.js:370 Warning: XFA - Cannot find the font: Arial
util.js:370 Warning: Font "Myriad Pro-Regular" is not available -- attempting to fallback to a default font.
util.js:370 Warning: Font "Myriad Pro-Bold" is not available -- attempting to fallback to a default font.
util.js:370 Warning: Font "Myriad Pro-Italic" is not available -- attempting to fallback to a default font.
util.js:370 Warning: Font "Myriad Pro-BoldItalic" is not available -- attempting to fallback to a default font.
util.js:370 Warning: Font "Arial-Regular" is not available -- attempting to fallback to a default font.
util.js:370 Warning: Font "Arial-Bold" is not available -- attempting to fallback to a default font.
util.js:370 Warning: Font "Arial-Italic" is not available -- attempting to fallback to a default font.
util.js:370 Warning: Font "Arial-BoldItalic" is not available -- attempting to fallback to a default font.
util.js:370 Warning: Font "PdfJS-Fallback-Regular" is not available -- attempting to fallback to a default font.
util.js:370 Warning: Font "PdfJS-Fallback-Bold" is not available -- attempting to fallback to a default font.
util.js:370 Warning: Font "PdfJS-Fallback-Italic" is not available -- attempting to fallback to a default font.
util.js:370 Warning: Font "PdfJS-Fallback-BoldItalic" is not available -- attempting to fallback to a default font.
This discussion was converted from issue #17872 on April 03, 2024 06:49.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi!
Configuration:
The vast majority of PDF documents display fine. But there is a small part of the documents (I can’t post them, this is prohibited by the employer’s policy) looks like this:
"To view the full contents of this document, you need a later version of the PDF viewer. You can upgrade to the latest version of Adobe Reader from ..."
Moreover, after rendering there is always 1 page, although there are more pages in the document.
If you add
enableXfa: true
in pdfjsLib.getDocument, then the number of pages in the document is already correct, but the document is empty, and the following message is displayed in the browser console:
I add
standardFontDataUrl: "http://localhost:2329/Scripts/plugins/pdf.js/standard_fonts/"
in pdfjsLib.getDocument, The document is still empty, the number of pages is correct, but there are fewer warnings in the browser console:
I tried adding the arial font, in ttf and svg formats to the http://localhost:2329/Scripts/plugins/pdf.js/standard_fonts/ folder, but there were no changes in the console or with the display of the document. Still a warning on Arial:
I also tried adding the font via ccs, but this did not solve the problem:
How to download fonts and display the document?
Beta Was this translation helpful? Give feedback.
All reactions