[Html2PdfConverter] Converting HTML to PDF converts the login page

Forge Component
(58)
Published on 2018-10-30 by Guilherme Pereira
58 votes
Published on 2018-10-30 by Guilherme Pereira

Hello All,

I am trying to convert an HTML into PDF which fetches data from the database based on the login information. But every time I try to convert , it converts the login page . It seems that it is not able to transfer the information from the session and when it tries to convert it takes it as an unauthenticated user.

Also please note that  I do not have any query or session information in the URL.

Any assistance will be very helpful.


Thanks & Regards

Rana

Solution

Rana,

This component lays on an executable, not a web application.
It needs a full URL address. If the web page you are providing is not anonymous, you will not get it.
Probably this is the reason why you are getting the login page. You are being redirected.

So, the solution is to allow public access of this webpage setting the anonymous Role option in it.

Cheers,
Eduardo Jauch

Solution

Eduardo Jauch wrote:

Rana,

This component lays on an executable, not a web application.
It needs a full URL address. If the web page you are providing is not anonymous, you will not get it.
Probably this is the reason why you are getting the login page. You are being redirected.

So, the solution is to allow public access of this webpage setting the anonymous Role option in it.

Cheers,
Eduardo Jauch

Thank You very much ED for the explanation


hello

What if you don't want to give the public access to it? I want my page to only be accessed by a certain role, and when I try to download I get the login page.

I used this URL function: 

MakeAbsoluteURL(GetEntryURL(GetPageName(),eSpaceName:GetEntryEspaceName(),FirstParameterName:,FirstParameterValue:,SecondParameterName:,SecondParameterValue:,ThirdParameterName:,ThirdParameterValue:,FourthParameterName:,FourthParameterValue:,FifthParameterName:,FifthParameterValue:))

Hi Rita,


If you don’t want to give public access unfortunately you can’t use this component. The screen has to be anonymous for it to work.


If you wan’t to secure it you can use the approach suggested here


Hope this helps,

Guilherme