[Html2PdfConverter] PDF not being generated by calling page via localhost

[Html2PdfConverter] PDF not being generated by calling page via localhost

  
Forge Component
(52)
Published on 30 Oct (2 weeks ago) by Guilherme Pereira
52 votes
Published on 30 Oct (2 weeks ago) by Guilherme Pereira

Hi,

I am using this extension to generate PDF and it is configured like below: 

The URL that I pass to this component looks like this: 

And then I pass this URL value:

And the page that generate PDF has a check to make sure request is coming from localhost:

And I've tried setting Breakpoint on the page that is converted to PDF but the request never reaches this page. I have uploaded the required binaries using the administration tool.

We've been using this configuration for a while and it was working on our on-prem environment but recently we moved to Outsystems Cloud and it isn't working there.


The PDF generated has a 404 error page: 


So it looks like the component is not able to reach the page via localhost. Am I missing something here or is this something that cannot be done via Outsystems Cloud?


Thanks,

Gurvinder

Hi Gurvinder,


Are you using the personal environment or an enterprise cloud?


have you try to get the URL and open it in your browser (replacing 127.0.0.1 with the actual hostname)?


Cheers,

Guilherme

Hi Guilherme,


Thanks for your prompt reply. 

We are using Cloud Demo environment (received as becoming a partner) and I believe it resembles more of a personal environment.


Yes, I have tried opening the URL using actual hostname and request reaches the page, but since it is not coming from localhost, we drop that request in preparation.


Thanks,

Gurvinder

Hi,


You're right. A demo environment also works in a cluster and as such you cannot reach it neither with 127.0.0.1 nor localhost.


In that case you can construct your URL using the function GetServerName() from the RichWidgets to get the hostname. Something like "http://" + GetServerName() + "...".


Let us know if this worked for you


Cheers,

Guilherme