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

set option disableFontFace #9778

Closed
diego-lipinski-de-castro opened this issue Jun 4, 2018 · 5 comments
Closed

set option disableFontFace #9778

diego-lipinski-de-castro opened this issue Jun 4, 2018 · 5 comments

Comments

@diego-lipinski-de-castro

How do set the option disableFontFace to false ? It is not an option in PDFJS anymore you can see at #6742, and then im falling into #4244.

It says - "We will remove any PDFJS.xxxx properties in the future. This one is probably belong to render() parameters." So, how do it works? I wasnt able to go through with this.

Configuration:

  • Chrome 66.0.3359.181 64 bits
  • MacOS High Sierra 10.13.4
  • 2.0.489 from CDN URL;
  • No
@timvandermeij
Copy link
Contributor

timvandermeij commented Jun 4, 2018

You can pass disableFontFace as a parameter to the getDocument API call. Refer to 0ecc22c#diff-304ad4918827181a1d1f52f5803717cdL64 for an example (note that we only removed that because we now handle this automatically for NodeJS environments, but this is the good way to pass the parameter) and https://github.com/mozilla/pdf.js/blob/master/src/display/api.js#L164 for the API documentation.

@diego-lipinski-de-castro
Copy link
Author

I'm doing it like

pdfjsLib.getDocument(url, { disableFontFace: true }).then(doc) => {}

but seems like nothing changed, it does not fallback, or what should I expect?

@timvandermeij
Copy link
Contributor

timvandermeij commented Jun 5, 2018

The getDocument call only expects one parameter, not two. I think it should be:

pdfjsLib.getDocument({ url, disableFontFace: true }).then(doc) => {...}

since url is also part of the DocumentInitParameters, just like disableFontFace (https://github.com/mozilla/pdf.js/blob/master/src/display/api.js#L111).

@diego-lipinski-de-castro
Copy link
Author

I'm fucking dumb, thanks for the help, you're right, i didnt pay attention to that

@timvandermeij
Copy link
Contributor

No worries, and good luck!

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