Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not use standardFontDataUrl #13646

Closed
NNSTH opened this issue Jun 29, 2021 · 3 comments
Closed

Can not use standardFontDataUrl #13646

NNSTH opened this issue Jun 29, 2021 · 3 comments

Comments

@NNSTH
Copy link

NNSTH commented Jun 29, 2021

Attach (recommended) or Link to PDF file here:thumbnailThis is my PDF file:
tmp.pdf

Configuration:

  • (Web Browser:) I'm using pdfjs-dist on Node server
  • Operating system and its version: Ubuntu 16.04
  • PDF.js version: 2.8.335
  • Is a browser extension: No.

Steps to reproduce the problem:
I took the code from examples/node/pdf2png in order to generate thumbnail to my pdf, using node canvas module.
so you can take the code from there and run it externally with latest version of pdfjs-dist.
I get a lot of warnings, like this:
Warning: getPathGenerator - ignoring character: "Error: Requesting object that isn't resolved yet Times_path_W.".
And the thumbnail generated is missing some of the text, see this png:
output

What is the expected behavior? The thumbnail has to look like this:
thumbnail

What went wrong? see the differences between the 2 images.

While searching within the code of pdfjs-dist in node-modules, it seems like the standardFontDataUrl is not used anywhere,
Is this the correct name? or am I missing something?

@Snuffleupagus
Copy link
Collaborator

PDF.js version: 2.8.335
[...]
it seems like the standardFontDataUrl is not used anywhere,

That functionality landed in PR #12726, which is new enough to not yet have been included in an official release; hence you'll either need to wait for a future release, or use the development version of the library (see https://github.com/mozilla/pdf.js#getting-the-code).

@NNSTH
Copy link
Author

NNSTH commented Jun 29, 2021

Thanks for the quick reply, and estimation for a future release?

@NNSTH
Copy link
Author

NNSTH commented Jun 30, 2021

I still get a partially document while trying to generate thumbnail of the pdf, I tried both pdf2png and pdf2svg from the examples, however, the result looks much different than the real pdf source.
e.g.: this is the source doc:
22-25-34-FINALTASKBCO226SP.pdf
and this is the generated png
output-test
Any idea of how can I use this code to get the desired output?
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants