This is an archived forum post. The information may be outdated. Contact us if you have any questions.

How we can generate a PDF for local instace urls

cskothuri wrote on 2020-11-24:
Hi,

We are planning to purchase a license to generate PDF for webpage urls using Java API of PDFCrowd.

But, while exploring/testing we observed that PDFCrowd API is not able to generate PDF for local instance/DMZ urls as PDFCrowd is a webservice.

And also I seen one of the forum where you mentioned that we can use localtunnel https://www.google.com/search?q=localtunnel to get rid of these issues. But I don't know how feasible it is using of localtunnel when I am working on client environments related to security and websites which are hosted through apache webservers.

Could you please suggest the best way which can consider for testing with local/DMZ urls.

Thank you.
support wrote on 2020-11-24:
Hi,

If you can't make local URLs accessible to Pdfcrowd service, try to save/render your local HTML to string or file and use convertString or convertFile API method. convertFile may contain an archive with all assets needed, so you can attach local images, CSS and JS also.

Alternative to the local tunnel is to enable access to local pages just for the Pdfcrowd conversion. It may be achieved by:
1. using a client certificate (API method setClientCertificate), e.g. for apache
https://www.google.com/search?channel=fs&client=ubuntu&q=apache+client+certificate
2. using a custom HTTP header with some secret value (API method setCustomHttpHeader)
3. using a custom cookie with some secret value (API method setCookies).