Html2PdfConverter - Wrong Page Converted to PDF

Html2PdfConverter - Wrong Page Converted to PDF

  

So i have a page with two tables displaying information in tables that i wish to convert and download as a PDF file at any time by clicking a button. The problem is that the generated PDF contains the wrong page: instead of the requested page, it converts the login page.

After debugging, i noticed that the URL generated by the GetBookmarkableURL action (which i pass as the URL parameter to the GeneratePDF action) generated the right URL.

Am i missing something?

Hi B_pal,


Put your correct page HAS ANONYMOUS. You site redirect to login because you dont HTMLPDF don't have permissions

It works but now i came across another problem: there are two search filters to filter the records from the tables between a start date and an end date. when i use the search filters on the tables and generate the PDF, it prints the initial values when the search parameters are reset instead of showing the filtered results.

Great, you have a logic problem, you print the same page? try create a page only to print and send to that page the input param....

Fábio Vaz wrote:

Great, you have a logic problem, you print the same page? try create a page only to print and send to that page the input param....

What input parameter?

And yes, i'm printing the same page. The tables and search filters are there after all...


b_pal wrote:

Fábio Vaz wrote:

Great, you have a logic problem, you print the same page? try create a page only to print and send to that page the input param....

What input parameter?

And yes, i'm printing the same page. The tables and search filters are there after all...


Try use another page with same content and call that page instead of current page.


What happens is that Html2PdfConverter will make a new request to the page that you are trying to print, with a different session. 

Because of this, you will never have the session values while printing (so no login nor values selected on the screen). 

To solve this, you have to send the search parameters as input parameters to the page so that it can be loaded again with the required data.


Just let me know if this helped.


Regards,

José Gomes