150
Views
18
Comments
Unable to generate PDF in Reactive Web app in Outsystems
Question

I am using HtmlToPDFGenerator to generate PDF in Reactive Web application. I have made my page anonymous and provided the URL. Upon Download the PDF is blank. However, If I provide google URL it generates the pdf properly.

I have also used UltimatePDF and it gives me an error "Error occurred while generating PDF"

I want to use this PDF to send as an email attachment.

2020-09-01 10-42-42
Stefano Valente

Can you share the OML or at least send the screenshots of your code?

UserImage.jpg
Bipin Raghuvanshi

I am just trying to download for now. Later the download will be replaced by the send email action.

2020-09-01 10-42-42
Stefano Valente

I am not sure if this is the problem, because o dont see the form you are trying to turn into pdf, but could it be this problem?

https://www.outsystems.com/forums/discussion/54758/getbookmarkableurl-not-returning-input-parameters-during-in-screen-notify-actio/


Edit:

Is this forge component also ok for reactive? 

what component are you using? i can have a look.

UserImage.jpg
Bipin Raghuvanshi

The component needs a URL to generate content for the PDF.I have tried putting Google URL and it is generating PDF successfully. However, If I put my application URL the PDF generated is blank although the page is anonymous.

I am using HtmlToPDFConverter . Is there any other other component? I have tried UltimatePDF as well but it throws error.

I don't have any input parameters for the app and i've tried harcoding the URL instead of GetBookmarkUrl() function. It gives me same result.

2020-09-01 10-42-42
Stefano Valente
UserImage.jpg
Bipin Raghuvanshi

No my form dosen't have input parameters. It is an anonymous page i have created with the content which I need for the PDF.


This is the component I am using:

https://www.outsystems.com/forge/component-overview/209/html2pdfconverter

2018-10-18 08-34-00
Eric Bulters
 
MVP

Hi Bipin,

Can you debug your application and check the url that is given with getbookmarkableurl() just to make sure it is redirecting to the correct page?

2020-09-01 10-42-42
Stefano Valente

when i want to install that component i get this:



UserImage.jpg
Bipin Raghuvanshi

Hi Eric,

Even if I hardcode the URL and make the page anonymous it still givens me blank content in the PDF. I am use a reactive web application.

UserImage.jpg
Bipin Raghuvanshi

Are you using a Reactive Web App? I am able to install the component.

2020-09-01 10-42-42
Stefano Valente

I am installing it now, but i had to force, because it says it might not be compatibel with my platform version.

2020-09-01 10-42-42
Stefano Valente

can you send a screenshot of your screen and its client actions? 

which client action does the download?

UserImage.jpg
Bipin Raghuvanshi

Below is the screenshot of download action:


2020-09-01 10-42-42
Stefano Valente

I think there are 2 possible causes:

1) this component is not meant for Reactive. I get an error when i want to install it as well:


2) it might display an empty page because the data retrieval is not done when the component converts the html to pdf.

In both situations i would try another tool.

Forge suggests the js version:

https://www.outsystems.com/forge/component-overview/9873/reactive-html2pdf-js



UserImage.jpg
Bipin Raghuvanshi

My ultimate goal is to send an email with PDF.  Reactive-html2pdf-js(https://www.outsystems.com/forge/component-overview/9873/reactive-html2pdf-js ) may not allow me to do that. Is there any component which exposes server actions which I can use?


2020-09-01 10-42-42
Stefano Valente

Outsystems Reactive does allow you to send emails. Not sure what you mean.


I have downloaded the component but now i need to update binaries etc. I am not going to do that.

If you like we can connect through Teams or skype, send me a personal message if you want that.

UserImage.jpg
Bipin Raghuvanshi

Hi Stefano ,

Yes I agree Outsystems allows me to send Email. But I am unable to generate a PDF to add as an attachment to that email. I need help to generate the PDF with content of my entire page.

2020-09-01 10-42-42
Stefano Valente

In reactive you can send an email with an attachment. 

So you can generate the pdf in client side with js forge component and then send it to the server action that send the email.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.