PDFTron setCustomFontURL with fonts rendered over HTTP

I want to make PDFTron to render fonts from localhost, I set setCustomFontURL to ‘HTTP://localhost/fonts/’ .
It downloads HTTP://localhost/fonts/fonts.json , but then it tries to download fonts from HTTPS://localhost/fonts/LiberationSerif.ttf.lzma etc. But I want HTTP not HTTPS.

How to fix this behaviour?

​Could you elaborate on why HTTP is important for you? Why not use HTTPS?
Why is localhost important?
Is all this just for evaluation purposes? Or is using HTTP how you want to go into production?

  1. I have an intranet machine, it has no internet connection, so we can’t download fonts from pdftron.com/fonts/ .
  2. Without internet, the only kind of HTTPS setup is with a self-signed domain certificate (which displays red errors, and is blocked by browsers unless clicked on “proceed to the site”).

So we have a HTTP version of the site, with the fonts loading locally.

I consider the only change in the SDK would be to use the same protocol from fonts.json for the font files, instead of automatically prepending “HTTPS://” to them, because the fonts.json file is loading fine if it’s served from HTTP .

Sorry for the long delay in an update.

I have an intranet machine, it has no internet connection,
Will this be your setup for “production”? Or just a restriction you are under during testing/evaluation?

If it is your production setup, can you elaborate on the scenario more (if you need to, you can reach out to us using our ticket forms if you need confidentiality.

Essentially there are technical reasons its setup to be HTTPS always, so we would need to know more about your requirements before we could investigate/commit further on allowing HTTP.

In the meantime, so you can continue evaluation without internet, is you could use the “file://” protocol instead, that will load the fonts using “file://”