Hello everyone,

I need help with the Html2pdfConverter component.
I have a page composed of a listRecord, which I want to convert to PDF. The page is called by link and is absolutely functional. What I want is to get the result in PDF.
To this end, at the end of the "Preparation" action, I want to invoke the server acction "GeneratePDF", using as url http: // <server_name> /folder/page.aspx?DataF=dd-MM-aaaa&DataI=dd-MM- aaaa.
The problem is that you always get the error "Access is denied."

thankful
Carlos Messias


Hi Carlos,

Is it only the component which is generating Access denied error or the browser as well?

Regards,

Swatatnra


Hello Swatatnra,

I'm afraid I didn't understand your question well.
I will try to better explain my problem:
- I have a webscreen composed of a listRecord, which I will call "List.aspx"
- when I call the webscreen "List.aspx", I get the desired result
- I now want the result to be converted to pdf. To this end, at the end of the "Preparation" action, I call a server "GeneratePDF" and a "Download" action, passing as url http: // <server_name> /folder/List.aspx


thankful
Carlos Messias


Hi Carlos,

Some things to keep in mind:

- You cannot call the GeneratePDF action in the preparation of that same page; you have to call it from another location. You would get a loop, since the preparation would also run when GeneratePDF calls the page. (Ok, you could use parameters and IF's).

- Make sure that the access to the page is set to Anonymous. This might explain the 'Access denied' you're getting. The PDF generator isn't a logged-in user. To secure your page, you might check if it is being accessed by the local machine

- Which brings me to 3: Instead of the full IP, you could also use localhost, since it's the server accessing the page on the same server.


Regards,
Lennart

Hello Lennart

Thanks for the replay.
In the meantime I changed the process.
In the "Preparation" action I removed the "GeneratePDF" and "Download" actions and put them both in a new "PDF" server action which is invoked by a link.
But I got another error:
Could not find file 'C: \ Windows \ TEMP \ TEMPRQPWJHJGJN00000000000000000000000000000000.pdf'.


Best regards,
Carlos Messias


Hi Carlos,

I have also seen these kind of errors. Most of the time with HtmlToPdf converter there is issue related with binaries.

Can you please go to /HtmlToPdfConverter/HowToPDF.aspx page and try to generate pdf using available 'Google' button, this will ensure whether config required is fine or not.

Thanks.

Hi Durgesh,


Thanks for your reply. 

I´m not able to login to the site.


Regards


Carlos Messias wrote:

Hi Durgesh,


Thanks for your reply. 

I´m not able to login to the site.


Regards


You can do login by using any available outsystems user in available env.

Thanks.


I´m trying with the user i use to login outsystems, without success.

Thanks


Solution

After all the problem was quite simple.
Passing 2 arguments had a space before &.
http://page.asp?arg1=x &arg2=y instead of http://page.asp?arg1=x&arg2=y.

best regards
Carlos Messias




Solution