[Html2PdfConverter] HTML TO PDF - Generate PDF

Forge Component
(61)
Published on 17 May by Guilherme Pereira
61 votes
Published on 17 May by Guilherme Pereira

Hello, i facing problems to generate a pdf from the html of the page!

Found some posts but didnt get...

My questions are:

How to configure the html2pdf so i will be able to generate pdfs?

What should i put on the URL and Proxy?

Can someone give a direct answer?

Im working on a project here on my company, waiting!

Thanks!

Hello Vinicius,


You configure your HTML2PDF using its application: 

In the administration screen you can upload the executables/libraries (you find those here: https://wkhtmltopdf.org/)

URL is the URL of the page (HTML) you want to convert to PDF.
Proxy you put "" unless you are under a proxy, than you put the proxy configuration.

Cheers,
Eduardo Jauch


Eduardo Jauch wrote:

Hello Vinicius,


You configure your HTML2PDF using its application: 

In the administration screen you can upload the executables/libraries (you find those here: https://wkhtmltopdf.org/)

URL is the URL of the page (HTML) you want to convert to PDF.
Proxy you put "" unless you are under a proxy, than you put the proxy configuration.

Cheers,
Eduardo Jauch


How do i get the url of the page?


Hello Vinicius,

What exactly are you trying to do?
If you are trying to convert a page, and you know its name, to make your app flexible, you can use the GetEntryURL function, passing two arguments: The module (eSpace), as the first argument, and the name of the page (without the extension) as the second input parameter. You can also give parameters to the page using this function, if the page require input parameters. 

Because the executable that will convert the page to PDF needs an absolute URL, you can put the GetEntrURL inside an MakeAbsoluteURL function.

Both functions are part of the HTTPRequestHandler extension and are described here:

https://success.outsystems.com/Documentation/10/Reference/OutSystems_APIs/HTTPRequestHandler_API

Cheers,
Eduardo Jauch

Eduardo Jauch wrote:

Hello Vinicius,

What exactly are you trying to do?
If you are trying to convert a page, and you know its name, to make your app flexible, you can use the GetEntryURL function, passing two arguments: The module (eSpace), as the first argument, and the name of the page (without the extension) as the second input parameter. You can also give parameters to the page using this function, if the page require input parameters. 

Because the executable that will convert the page to PDF needs an absolute URL, you can put the GetEntrURL inside an MakeAbsoluteURL function.

Both functions are part of the HTTPRequestHandler extension and are described here:

https://success.outsystems.com/Documentation/10/Reference/OutSystems_APIs/HTTPRequestHandler_API

Cheers,
Eduardo Jauch

Hello having some problems:

1: Configured on the htmltopdf website;

2: Putted on the url field:

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

And in proxy: ""

3: Receiving the error:

Could not find file 'C:\Users\CCCE64~1\AppData\Local\Temp\TEMPUVKCYIRQNE00000000000000000000000000000000.pdf'.

4: As you asked, i have a detail page and i wanna generate a pdf and download it from this detail page... Using the htmltopdf...

Cheers!

Hello Vinicius,

This is a very common error.

It means that the PDF that should be generated wasn't.
There are N reasons for that, but let's see if we can eliminate the simpler ones first.

1. Verify if the web page you are trying to convert to PDF has the anonymous Role checked. This is mandatory, as the executable that will load it will do this in an anonymous way. There are some ways to deal with this "security" question, if required.

2. Verify if you uploaded the correct binaries. The best option is to download the MingW option, as you will need only the executables (one for PDF, one for Image, and a single dll), at this link. The other version requires more files to be uploaded.

3. If you are using an On Premises server installation (your own server, not one provided by OutSystems in the cloud), check if the IIS has access to the Temp directory. If you are using a Cloud server, you are probably good here.

Usually, 95% of time, is a problem of access to the web page (1) or incorrect binaries (2).

Hope this helps solve this issue :)

Cheers,
Eduardo Jauch

Eduardo Jauch wrote:

Hello Vinicius,

This is a very common error.

It means that the PDF that should be generated wasn't.
There are N reasons for that, but let's see if we can eliminate the simpler ones first.

1. Verify if the web page you are trying to convert to PDF has the anonymous Role checked. This is mandatory, as the executable that will load it will do this in an anonymous way. There are some ways to deal with this "security" question, if required.

2. Verify if you uploaded the correct binaries. The best option is to download the MingW option, as you will need only the executables (one for PDF, one for Image, and a single dll), at this link. The other version requires more files to be uploaded.

3. If you are using an On Premises server installation (your own server, not one provided by OutSystems in the cloud), check if the IIS has access to the Temp directory. If you are using a Cloud server, you are probably good here.

Usually, 95% of time, is a problem of access to the web page (1) or incorrect binaries (2).

Hope this helps solve this issue :)

Cheers,
Eduardo Jauch

Hello, stil facing this erros:

Could not find file 'C:\Users\CCCE64~1\AppData\Local\Temp\TEMPXNOGHGTOBI00000000000000000000000000000000.pdf'.

I marked anonymous on the page, i downloaded the mingw and added the files!

What else could be? Can be this mingw files? 

Cheers!


Hi,

Your server is in an OutSystems cloud or you have your own server?

Can you provide a small OML so I can test on my installation to figure if it is a problem with the files?
A simple page, anonymous, with the action to convert to PDF and download it, the way you are doing will do. 

Cheers,
Eduardo Jauch

Eduardo Jauch wrote:

Hi,

Your server is in an OutSystems cloud or you have your own server?

Can you provide a small OML so I can test on my installation to figure if it is a problem with the files?
A simple page, anonymous, with the action to convert to PDF and download it, the way you are doing will do. 

Cheers,
Eduardo Jauch


Its an outsystems cloud...

Its on atachment!!


Eduardo Jauch wrote:

Hi,

Your server is in an OutSystems cloud or you have your own server?

Can you provide a small OML so I can test on my installation to figure if it is a problem with the files?
A simple page, anonymous, with the action to convert to PDF and download it, the way you are doing will do. 

Cheers,
Eduardo Jauch

I think the attachment didnt worked so sending pictures for you....


Hello Vinicius, 

I was talking about the module itself :)
But no problem.

Let's do a different test.

Do you set up the files like this, right?

From the MINGW, right? (the executables have around 28MB size)

Than, you go to this address: <put here your server address>//HtmlToPDFConverter/HowToPDF.aspx
And click the button "Google". It should give you a PDF of the main page of the google. 

If you get this correct and you receive a proper PDF, you have a problem in your APP (and I would like to take a look on it to be able to help you, even if everything seems ok)

If not, you can enable the LOG messages under the Administration page

And try the test again. Than go to the monitoring page (Service Center) and look for messages of this module/application so we can see what is the problem (with stack trace and everything).

Cheers,
Eduardo Jauch

Eduardo Jauch wrote:

Hello Vinicius, 

I was talking about the module itself :)
But no problem.

Let's do a different test.

Do you set up the files like this, right?

From the MINGW, right? (the executables have around 28MB size)

Than, you go to this address: <put here your server address>//HtmlToPDFConverter/HowToPDF.aspx
And click the button "Google". It should give you a PDF of the main page of the google. 

If you get this correct and you receive a proper PDF, you have a problem in your APP (and I would like to take a look on it to be able to help you, even if everything seems ok)

If not, you can enable the LOG messages under the Administration page

And try the test again. Than go to the monitoring page (Service Center) and look for messages of this module/application so we can see what is the problem (with stack trace and everything).

Cheers,
Eduardo Jauch

Hi, i made this test with google, he download a pdf and when i open this pdf he says this:

Error

Failed to load PDF document.

The problem are the files?



Eduardo Jauch wrote:

Hello Vinicius, 

I was talking about the module itself :)
But no problem.

Let's do a different test.

Do you set up the files like this, right?

From the MINGW, right? (the executables have around 28MB size)

Than, you go to this address: <put here your server address>//HtmlToPDFConverter/HowToPDF.aspx
And click the button "Google". It should give you a PDF of the main page of the google. 

If you get this correct and you receive a proper PDF, you have a problem in your APP (and I would like to take a look on it to be able to help you, even if everything seems ok)

If not, you can enable the LOG messages under the Administration page

And try the test again. Than go to the monitoring page (Service Center) and look for messages of this module/application so we can see what is the problem (with stack trace and everything).

Cheers,
Eduardo Jauch

On the log he returned me this:

2017-08-25 12:44:26HtmlToPdfConverter
(Html2PdfConverter)
Path [C:\OutSystems\Sandboxes\CCJL5R044\Platform Server\running\HtmlToPdfConverter\\binaries\wkhtmltopdf.exe] URL [www.google.com] Proxy [] OtherArgs [ ]DEBUG

Eduardo Jauch wrote:

Hello Vinicius, 

I was talking about the module itself :)
But no problem.

Let's do a different test.

Do you set up the files like this, right?

From the MINGW, right? (the executables have around 28MB size)

Than, you go to this address: <put here your server address>//HtmlToPDFConverter/HowToPDF.aspx
And click the button "Google". It should give you a PDF of the main page of the google. 

If you get this correct and you receive a proper PDF, you have a problem in your APP (and I would like to take a look on it to be able to help you, even if everything seems ok)

If not, you can enable the LOG messages under the Administration page

And try the test again. Than go to the monitoring page (Service Center) and look for messages of this module/application so we can see what is the problem (with stack trace and everything).

Cheers,
Eduardo Jauch

And when i try to do on the app:

Could not find file 'C:\Users\CCCE64~1\AppData\Local\Temp\TEMPQSNPJKVEUV00000000000000000000000000000000.pdf'.


Hi Vinicius,

Your application is ok. I can generate PDFs here without problems.

It's funny, because in our server, we had to use one pack (MSCV), but in my personal, I just installed and had to use the MING, as it didn't worked with the MSCV (probably missing some libraries)

Try this executables+library. If they don't work, you can try the version from the MSCV (here), but the first files are the ones I'm using in my personal (cloud), while the second link is the same as we have in local server. The first doesn't work in our local, the last doesn't work in my personal (cloud).

If none of the file sets works, you will need to talk to OutSystems (it seems to be an enterprise installation), to figure out what is the problem. If it is a personal, the first set will work. 

Cheers,
Eduardo Jauch

Eduardo Jauch wrote:

Hi Vinicius,

Your application is ok. I can generate PDFs here without problems.

It's funny, because in our server, we had to use one pack (MSCV), but in my personal, I just installed and had to use the MING, as it didn't worked with the MSCV (probably missing some libraries)

Try this executables+library. If they don't work, you can try the version from the MSCV (here), but the first files are the ones I'm using in my personal (cloud), while the second link is the same as we have in local server. The first doesn't work in our local, the last doesn't work in my personal (cloud).

If none of the file sets works, you will need to talk to OutSystems (it seems to be an enterprise installation), to figure out what is the problem. If it is a personal, the first set will work. 

Cheers,
Eduardo Jauch

Discovered the problem, the internet from my company was blocking or doing something that why wasnt working, i used the 4g from my phone and worked but on the pdf im receiving this error:

[CCJL5R044].DBO.[OSSYS_USER_T20] with key 0 was not found

An internal error occurred and was logged.Please try again later or contact the administration team.Sorry for any inconvenience

Probably the url isnt right...


Vinicius Schonardie wrote:

Eduardo Jauch wrote:

Hi Vinicius,

Your application is ok. I can generate PDFs here without problems.

It's funny, because in our server, we had to use one pack (MSCV), but in my personal, I just installed and had to use the MING, as it didn't worked with the MSCV (probably missing some libraries)

Try this executables+library. If they don't work, you can try the version from the MSCV (here), but the first files are the ones I'm using in my personal (cloud), while the second link is the same as we have in local server. The first doesn't work in our local, the last doesn't work in my personal (cloud).

If none of the file sets works, you will need to talk to OutSystems (it seems to be an enterprise installation), to figure out what is the problem. If it is a personal, the first set will work. 

Cheers,
Eduardo Jauch

Discovered the problem, the internet from my company was blocking or doing something that why wasnt working, i used the 4g from my phone and worked but on the pdf im receiving this error:

[CCJL5R044].DBO.[OSSYS_USER_T20] with key 0 was not found

An internal error occurred and was logged.Please try again later or contact the administration team.Sorry for any inconvenience

Probably the url isnt right...


Hi Vinicius,

Nope. The error you are experiencing is that you are trying to convert to PDF a page that requires a UserId, probably from the Logged UserId, or from an Input Parameter.

But as this page will be called by the executable, that does not know anything about the page itself, you will have to pass the UserId using the parameters in the GetEntryURL, so that this will be passed to the page when it is called by the PDF executable.

Yeah. I found it.
On my test, I deleted everything just to test the PDF and the PDF was working.

But the aggregate in your page requires the logged user id:

So, I suggest you to add UserId as input parameter to the page and use it in the filter, instead of the GetUserId().
In fact, you should never use this form GetTable(id), because if the Id is NullIdentifier, you will get an error.

So, change your filter to something like this: Ctsc.Ctc = UserName 

In the preparation, you fill the UserName with GetUser(UserId).user.UserName, where this UserId is the input parameter, and you use the GetUserId() in the links to this page.

Then add the UserId to the page address of the page in the form:

MakeAbsoluteURL(GetEntryURL(GetPageName(),GetEntryEspaceName(),"UserId",GetUserId()))

And it will work (I hope) ;)

Cheers,
Eduardo Jauch

Eduardo Jauch wrote:

Yeah. I found it.
On my test, I deleted everything just to test the PDF and the PDF was working.

But the aggregate in your page requires the logged user id:

So, I suggest you to add UserId as input parameter to the page and use it in the filter, instead of the GetUserId().
In fact, you should never use this form GetTable(id), because if the Id is NullIdentifier, you will get an error.

So, change your filter to something like this: Ctsc.Ctc = UserName 

In the preparation, you fill the UserName with GetUser(UserId).user.UserName, where this UserId is the input parameter, and you use the GetUserId() in the links to this page.

Then add the UserId to the page address of the page in the form:

MakeAbsoluteURL(GetEntryURL(GetPageName(),GetEntryEspaceName(),"UserId",GetUserId()))

And it will work (I hope) ;)

Cheers,
Eduardo Jauch

Putted the user on the url and worked!

Thanks a lot djow!


Eduardo Jauch wrote:

Yeah. I found it.
On my test, I deleted everything just to test the PDF and the PDF was working.

But the aggregate in your page requires the logged user id:

So, I suggest you to add UserId as input parameter to the page and use it in the filter, instead of the GetUserId().
In fact, you should never use this form GetTable(id), because if the Id is NullIdentifier, you will get an error.

So, change your filter to something like this: Ctsc.Ctc = UserName 

In the preparation, you fill the UserName with GetUser(UserId).user.UserName, where this UserId is the input parameter, and you use the GetUserId() in the links to this page.

Then add the UserId to the page address of the page in the form:

MakeAbsoluteURL(GetEntryURL(GetPageName(),GetEntryEspaceName(),"UserId",GetUserId()))

And it will work (I hope) ;)

Cheers,
Eduardo Jauch

HeyEduardo how are you? Im facing something about this, sometimes i will have a list of Products lets say, and i want to show this on the pdf in a pretty way... I wanted to use the table records, but this doesnt work, like work but doesnt show everything or a pretty way, i need to format something to show properly? How it works?

Thanks!


Hello Vinicius,

In theory, what the pdf conversor does is to create a PDF version of the web page, exactly as it is.
Can you share a picture of your page and a PDF to us to see about what's the problem?

Cheers,
Eduardo Jauch

Eduardo Jauch wrote:

Hello Vinicius,

In theory, what the pdf conversor does is to create a PDF version of the web page, exactly as it is.
Can you share a picture of your page and a PDF to us to see about what's the problem?

Cheers,
Eduardo Jauch

This is how i want to appear, will show more than one...

This is how he puts on the pdf:

He shows only one column and full fill the hole space...

Hum... The server is assuming that your page should be displayed in mobile...
This is the reason why it is "changing" the style.

Are you asking the PDF from a "mobile"? This is a silly question, as the executable asking the page is in the server... Anyway...

Hum...

Let me ask something less stupid...
Are you setting any parameter in the Action that executes the conversion to limit the size of the page?

If this is the case (and you need this way), you can define this style in the Style of the TableRecords: "TableRecords NoResponsive"

This will prevent the table of change if the server thinks the page is too small.

Cheers,
Eduardo Jauch

Hi Vinicius,


The output you're getting is perfectly normal. As the output page is A4 size by default in terms of size vs resolution it is interpreted as being displayed on tablet hence the output.


As Eduardo suggested you could add the NoResponsive style to your table to prevent it from breaking up other responsive behaviors could be applied. If you want to avoid all responsive behaviors (as well as known SILK UI incompatibility) what you can do is create a complete new blank theme not inheriting from any other and then apply it to a new webflow with the page to be printed. For this you to have two versions of the page (one for showing and one for printing to pdf) but should eliminate any responsive behavior.


Cheers,

Guilherme

I changed to Table records no responsive, i just copied this there, dont even had the option but he accepted, but didnt worked...

Guilherme Pereira wrote:

Hi Vinicius,


The output you're getting is perfectly normal. As the output page is A4 size by default in terms of size vs resolution it is interpreted as being displayed on tablet hence the output.


As Eduardo suggested you could add the NoResponsive style to your table to prevent it from breaking up other responsive behaviors could be applied. If you want to avoid all responsive behaviors (as well as known SILK UI incompatibility) what you can do is create a complete new blank theme not inheriting from any other and then apply it to a new webflow with the page to be printed. For this you to have two versions of the page (one for showing and one for printing to pdf) but should eliminate any responsive behavior.


Cheers,

Guilherme

How i put this different theme just for a page?


Hello Vinicius,

The "NoResponsive" should have done the trick. Can you share to take a look?

In any case, you can define a different theme in an application in a different flow. (Each flow can use a different theme).

Cheers,
Eduardo Jauch

Eduardo Jauch wrote:

Hello Vinicius,

The "NoResponsive" should have done the trick. Can you share to take a look?

In any case, you can define a different theme in an application in a different flow. (Each flow can use a different theme).

Cheers,
Eduardo Jauch

If the no responsive doesnt work, i will ask you for a better explanation about the theme... hah

This is how im doing.... Just copied the phrase: TableRecord NoResponsive, as its there, and didnt worked!

Eduardo Jauch wrote:

Hello Vinicius,

The "NoResponsive" should have done the trick. Can you share to take a look?

In any case, you can define a different theme in an application in a different flow. (Each flow can use a different theme).

Cheers,
Eduardo Jauch

Hello Eduardo, any idea?


Hello Vinicius,

Are you using a Silk UI theme? It works only in Silk UI...
I have to do some tests, but will have time only tomorrow.

Cheers,
Eduardo Jauch

Solution

Eduardo Jauch wrote:

Hello Vinicius,

Are you using a Silk UI theme? It works only in Silk UI...
I have to do some tests, but will have time only tomorrow.

Cheers,
Eduardo Jauch


I did it, i changed the theme off the page and putted no responsive and workedd!!

Solution

Hello Vinicius!

I'm glad we were able to help you find the solution :)

I'll ask a small favor.
Regarding the correct answer, please, mark one of the answers related to the original question, as this will help people one searching the forum. ;)

Thanks!

Cheers,
Eduardo Jauch

Hi Eduardo,

I really appreciate your patience and help on this topic, i am too facing some issues regarding this component but now i am all clear.

Regards,

Manish Jawla

Good to hear, Manish :)

Appreciate the help just finished it and working great.
https://html-2-pdf.com

Hi Eduardo Jauch,


Hi Eduardo...Can u pls help me .... I was able to generate PDF but.. its headers are coming overlapped with previous page data..


Please help 

Hi, 

I am done with my installation. But i am not able to download the pdf. can anyone help me out with a solution.

Regards,

Koushik

Hi All,

I have marked the screen as public and set it anonymous as well, but still when i download it, it does not render the data in PDF, also the formatting of layout is not maintained.

Please guide me what all possible values of above parameters can help me to get the content of the page on PDF along with formatting intact.

On some pages, i am just getting login page when i download the PDF.

 

Pawan Kumar Sharma wrote:

Hi All,

I have marked the screen as public and set it anonymous as well, but still when i download it, it does not render the data in PDF, also the formatting of layout is not maintained.

Please guide me what all possible values of above parameters can help me to get the content of the page on PDF along with formatting intact.

On some pages, i am just getting login page when i download the PDF.

 

Hi Pawan ,

Are are you using any session variable or site property in fetching data .

what exactly or how you are creating the URL of the page which u are passing to PDF generation function. 


Regards ,

Nitesh

Nitesh Ahirwar wrote:

Pawan Kumar Sharma wrote:

Hi All,

I have marked the screen as public and set it anonymous as well, but still when i download it, it does not render the data in PDF, also the formatting of layout is not maintained.

Please guide me what all possible values of above parameters can help me to get the content of the page on PDF along with formatting intact.

On some pages, i am just getting login page when i download the PDF.

 

Hi Pawan ,

Are are you using any session variable or site property in fetching data .

what exactly or how you are creating the URL of the page which u are passing to PDF generation function. 


Regards ,

Nitesh

Hi Nitesh, I am creating the URL of same page with all parameters values appended to render it back with same content. I checked hitting that URL from New Tab, It renders everything fine as i want in download or print. I have a doubt, that I have one Web Block, where User Permission check is kept, in same HTML page & that web block renders the MAP, when I removed it, It worked, I was able to download the PDF with remaining content. 

But I need to print that map also on that PDF as per my requirement, how to achieve that, because as soon as I am including that Web Block of Map in HTML page, Component doesn't download right content in PDF, it only prints login page.



Pawan Kumar Sharma wrote:

Nitesh Ahirwar wrote:

Pawan Kumar Sharma wrote:

Hi All,

I have marked the screen as public and set it anonymous as well, but still when i download it, it does not render the data in PDF, also the formatting of layout is not maintained.

Please guide me what all possible values of above parameters can help me to get the content of the page on PDF along with formatting intact.

On some pages, i am just getting login page when i download the PDF.

 

Hi Pawan ,

Are are you using any session variable or site property in fetching data .

what exactly or how you are creating the URL of the page which u are passing to PDF generation function. 


Regards ,

Nitesh

Hi Nitesh, I am creating the URL of same page with all parameters values appended to render it back with same content. I checked hitting that URL from New Tab, It renders everything fine as i want in download or print. I have a doubt, that I have one Web Block, where User Permission check is kept, in same HTML page & that web block renders the MAP, when I removed it, It worked, I was able to download the PDF with remaining content. 

But I need to print that map also on that PDF as per my requirement, how to achieve that, because as soon as I am including that Web Block of Map in HTML page, Component doesn't download right content in PDF, it only prints login page.



Hey Pawan ,

That could be the reason since you are using webbock where user permissions are required to render .where as to make PDF generation with content you desired , it needs only anonymous access to the URL and data needs to be rendered without any user check , session variable or site property .

Try using rendering MAP without user check on the html page ( i assume that you are making PDF downloadable to logged in user itself , since you doesn't required to check user again.)


Thanks,

Nitesh


In this case, The Map is generated Dynamically based on User Id and location. That's where I am not sure, how to achieve it. I can not skip passing User Id and Location to this Web Block.Based on the passed values, we make some api calls & get the ordinates to show on map in preparation of Web Block.

Hi All, I have a Web Block inside the page, which is fetching the data using api calls. In PDF, i am able to get the static content of that Page, But dynamic values or values from API calls are coming as empty. Anybody knows, what can be done in this case to make it work? Also Map issue remains open as discussed in previous comment.

Pawan Kumar Sharma wrote:

In this case, The Map is generated Dynamically based on User Id and location. That's where I am not sure, how to achieve it. I can not skip passing User Id and Location to this Web Block.Based on the passed values, we make some api calls & get the ordinates to show on map in preparation of Web Block.

Hi Pawan ,

Could you show me how u r creating and passing the url to the generate pdf function. may be that could be the case.

Try creating URL like below .

 

Thanks,

Nitesh

Nitesh Ahirwar wrote:

Pawan Kumar Sharma wrote:

In this case, The Map is generated Dynamically based on User Id and location. That's where I am not sure, how to achieve it. I can not skip passing User Id and Location to this Web Block.Based on the passed values, we make some api calls & get the ordinates to show on map in preparation of Web Block.

Hi Pawan ,

Could you show me how u r creating and passing the url to the generate pdf function. may be that could be the case.

Try creating URL like below .

 

Thanks,

Nitesh


Hi Nitesh,

I am also making absolute URL same way. I have user ID as the input parameter to this screen. Thing is that, I have lot of permission checks on the page. Page contains multiple web blocks which internally, have other Web Blocks, where again some permission check is present. Similarly there is a map web block which also gets rendered based on permission. The problem is when component would be calling this page, this will fail on multiple web blocks hence, login page is downloaded.

To overcome this issue, I am using login action in preparation with the user Id that i sent as part of input parameter in URL & that is input parameter to screen as well. By doing so I was at least able to download the PDF with some content, though map still didn't render. 

Pawan Kumar Sharma wrote:

Nitesh Ahirwar wrote:

Pawan Kumar Sharma wrote:

In this case, The Map is generated Dynamically based on User Id and location. That's where I am not sure, how to achieve it. I can not skip passing User Id and Location to this Web Block.Based on the passed values, we make some api calls & get the ordinates to show on map in preparation of Web Block.

Hi Pawan ,

Could you show me how u r creating and passing the url to the generate pdf function. may be that could be the case.

Try creating URL like below .

 

Thanks,

Nitesh


Hi Nitesh,

I am also making absolute URL same way. I have user ID as the input parameter to this screen. Thing is that, I have lot of permission checks on the page. Page contains multiple web blocks which internally, have other Web Blocks, where again some permission check is present. Similarly there is a map web block which also gets rendered based on permission. The problem is when component would be calling this page, this will fail on multiple web blocks hence, login page is downloaded.

To overcome this issue, I am using login action in preparation with the user Id that i sent as part of input parameter in URL & that is input parameter to screen as well. By doing so I was at least able to download the PDF with some content, though map still didn't render. 

Hi Pawan ,

Issue is that only that you are using permissions on webblock . To make pdf generation to work, page can contain dynamic content but should not have any state management blocks or variable like sessions , user checks , site properties etc. You may render this page correctly on you browser but PDF generation method only generates content which do not have these checks or variables .

Try any alternate to have checks on users on ur weblock , avoid any session variables , site properties or state management technique. It can render only content which is anonymous.


Thanks.

Nitesh


Hi ,

Thank you for the info.
I am trying to download wkhtmltopdf and upload the exe files in the HtmlToPdfConverter/Administration.aspx.

But I am not able to upload the .exe files. Below is the error.

Could not find a part of the path 'D:\wkhtmltox-0.12.5-1.mxe-cross-win64\wkhtmltox\binaries'

Can some one help from where can I get the binaries folder to upload the .exe files.


Thanks,

Saicharan

sai charan wrote:

Hi ,

Thank you for the info.
I am trying to download wkhtmltopdf and upload the exe files in the HtmlToPdfConverter/Administration.aspx.

But I am not able to upload the .exe files. Below is the error.

Could not find a part of the path 'D:\wkhtmltox-0.12.5-1.mxe-cross-win64\wkhtmltox\binaries'

Can some one help from where can I get the binaries folder to upload the .exe files.


Thanks,

Saicharan

Hi Sai ,

Are you trying to upload files for personal or enterprise environment.


Nitesh Ahirwar wrote:

sai charan wrote:

Hi ,

Thank you for the info.
I am trying to download wkhtmltopdf and upload the exe files in the HtmlToPdfConverter/Administration.aspx.

But I am not able to upload the .exe files. Below is the error.

Could not find a part of the path 'D:\wkhtmltox-0.12.5-1.mxe-cross-win64\wkhtmltox\binaries'

Can some one help from where can I get the binaries folder to upload the .exe files.


Thanks,

Saicharan

Hi Sai ,

Are you trying to upload files for personal or enterprise environment.


Hi Nitesh,

I am doing this in local environment using the trial version of outsystems. Please let me know if I can implement preview and download pdf functionality in the trial version of outsystems in local environment.


Thanks,

Saicharan


sai charan wrote:

Nitesh Ahirwar wrote:

sai charan wrote:

Hi ,

Thank you for the info.
I am trying to download wkhtmltopdf and upload the exe files in the HtmlToPdfConverter/Administration.aspx.

But I am not able to upload the .exe files. Below is the error.

Could not find a part of the path 'D:\wkhtmltox-0.12.5-1.mxe-cross-win64\wkhtmltox\binaries'

Can some one help from where can I get the binaries folder to upload the .exe files.


Thanks,

Saicharan

Hi Sai ,

Are you trying to upload files for personal or enterprise environment.


Hi Nitesh,

I am doing this in local environment using the trial version of outsystems. Please let me know if I can implement preview and download pdf functionality in the trial version of outsystems in local environment.


Thanks,

Saicharan



Hi Sai ,


Keep the following settings and upload binaries to your htmltopdfconverter's extension in your env. from here https://wkhtmltopdf.org/downloads.html according to your systems requirement and then check.

Nitesh Ahirwar wrote:

sai charan wrote:

Nitesh Ahirwar wrote:

sai charan wrote:

Hi ,

Thank you for the info.
I am trying to download wkhtmltopdf and upload the exe files in the HtmlToPdfConverter/Administration.aspx.

But I am not able to upload the .exe files. Below is the error.

Could not find a part of the path 'D:\wkhtmltox-0.12.5-1.mxe-cross-win64\wkhtmltox\binaries'

Can some one help from where can I get the binaries folder to upload the .exe files.


Thanks,

Saicharan

Hi Sai ,

Are you trying to upload files for personal or enterprise environment.


Hi Nitesh,

I am doing this in local environment using the trial version of outsystems. Please let me know if I can implement preview and download pdf functionality in the trial version of outsystems in local environment.


Thanks,

Saicharan



Hi Sai ,


Keep the following settings and upload binaries to your htmltopdfconverter's extension in your env. from here https://wkhtmltopdf.org/downloads.html according to your systems requirement and then check.

Hi Nitesh,

I have followed the same process. Downloaded binaries and tried to upload in the administration path shown above. But the binaries are not getting uploaded, says that the 'path does not contain binaries folder structure' error.

Thanks,

Saicharan


Hi All,

Can some one help me providing the executable files zip folder. For some reason, when I am trying to download , binaries and other folder structure is missing. I believe thats the reason, I cannot execute the generate pdf functionality.

Thanks,

Saicharan

Hi,

I am facing below issue while trying to generate pdf. Binaries are uploaded successfully.

C:\Users\CSBDFD~1\AppData\Local\Temp\TEMPSTLDIKXBKH00000000000000000000000000000000.pdf'. Qt: Untested Windows version 10.0 detected! SetProcessDpiAwareness failed: "COM error 0xffffffff80070005 (Unknown error 0x0ffffffff80070005)" Error: This version of wkhtmltopdf is build against an unpatched version of QT, and does not support more then one input document. Exit with code 1, due to unknown error. 


Thanks,

Saicharan

sai charan wrote:

Hi,

I am facing below issue while trying to generate pdf. Binaries are uploaded successfully.

C:\Users\CSBDFD~1\AppData\Local\Temp\TEMPSTLDIKXBKH00000000000000000000000000000000.pdf'. Qt: Untested Windows version 10.0 detected! SetProcessDpiAwareness failed: "COM error 0xffffffff80070005 (Unknown error 0x0ffffffff80070005)" Error: This version of wkhtmltopdf is build against an unpatched version of QT, and does not support more then one input document. Exit with code 1, due to unknown error. 


Thanks,

Saicharan

Hi Saicharan,

Instead of going to all different posts with the same question can we stick to the discussion in only one?

If you can answer the questions here we may be able to understand what the issue is and try to render some assistance

Thanks,

Guilherme

I think even with Permission check also this component can be made work. We need to pass user id after encrypting it and then when component calls back the page asynchrounously, then in preparation we need to decrypt user name & check for related permissions after doing a login without password.

or to even make it more secure, we can use cookie as well to ensure user's & same browser session identity.

Let me know your thoughts.