Hi Everyone,
I am receiving a Local List from one block.
My requirement is: Convert the Local List table data into a PDF document.
I Convert the generated PDF binary into a Base64 string. I tried using HTML2PDF by generating HTML from the list data and passing the HTML to the PDF generation action. However, the PDF generation is failing and returns a 0-byte PDF with the following error - "Cannot call a class as a function"
JS is attached
Thank you,
Nihil
Hi @Nihil Gujar ,
Can you link the exact component you are using? There are multiple "HTML2PDF" component in the forge.
I tried your approach with this component, and it worked: https://www.outsystems.com/forge/component-overview/10546/html2pdf-o11 .
Try using that one.
Hello,
Can you please add oml for reference purpose?
Hi,
You can see the implementation in this OML. It fetches the Users, then appends them to a local list, and I created an action like yours.
Hi @Mihai Melencu ,
I tried your application but this one also returns me 0 bytes, can you please confirm version of HTML2PDF.
My versions:
HTML2PDF - 2.0.2
HTML2PDF_ext - 2.0.1
I have the same versions. Can you share your OML with the implementation?
I’m unable to share my organization’s OML due to restrictions. However, I only made a minor change to your application by adding one additional action.
Your new module had dependencies on some of your other modules. Since I don’t have access to them, I created my own Employee structure to match the format expected by your JavaScript. I also created a wrapper action that generates the PDF and converts it to Base64.
Seems to be working fine:
Please test on your side and let me know if it's working.
I am getting this error message from Generate Pdf - "Problem generating PDF from HTML, URLs: -, outputFilename: C:\Users\OutSystemsApplications\AppData\Local\Temp\.local-HtmlToPdfConverter\7a0c56c1-7323-478a-9419-795dea2a6fb7.pdf"
Hi, please check the solution from this discussion: [HTML2PDF] problem generating with PDF from html, URLs: -,outputFileNanme: C:\Users\OutsystemsAp | OutSystems