HowTo : Want to create pdf in Mobile App from local entity

Hi,


I want to create pdf in mobile to be used offline from local entitys. Please have a look at the below URL: 


https://devsoftware-dev.outsystemsenterprise.com/ipruhealthcalculator/BenefitIllustration.aspx?Token=eyJBZ2UiOiIyOCIsIkdlbmRlciI6Ik1hbGUiLCJQb2xpY3lUZXJtIjoiMTAiLCJTdW1Bc3N1cmVkSGVhnQiOiIyNTAwMDAwIiwiU3VtQXNzdXJlZENhbmNlciI6IjAiLCJQcmVtaXVtRnJlcSI6IlNpbmdsZSIsIkZpcnN0WWVhckV4VGF4ZXNIZWFydEFwcGxpY2FudDEiOiI2Njc2IiwiRmlyc3RZZWFySW5UYXhlc0NhbmNlckFwcGxpY2FudDIiOiIwIiwiU2Vjb25kWWVhckV4VGF4ZXNDYW5jZXJBcHBsaWNhbnQyIjoiMCIsIlNlY29uZFllYXJFeFRheGVzSGVhcnRBcHBsaWNhbnQyIjoiMCIsIlNlY29uZFllYXJJblRheGVzQ2FuY2VyckFwcGxpY2FudDIiOiIwIiwiU2Vjb25kWWVhckluVGF4ZXNIZWFydEFwcGxpY2FudDIiOiIwIiwiVG90YWxQcmVtaXVtUGF5YWJsZUFwcGxpY2FudDIiOiIwIiwiVG90YWxQcmVtaXVtUGF5YWJsZUFwcGxpY2FudDEiOiI3ODc4IiwiRmlyc3RZZWFyRXhUYXhlc0hlYXJ0QXBwbGljYW50MiI6IjAifQ%3d%3d&FirstYearExTaxesCancertApplicant2=0&FirstYearInTaxesHeartApplicant2=0&FirstYearExTaxesCancerApplicant1=0&FirstYearInTaxesHeartApplicant1=7878&FirstYearInTaxesCancerApplicant1=0&SecondYearExTaxesHeartApplicant1=6676&SecondYearExTaxesCancerApplicant1=0&SecondYearInTaxesHeartApplicant1=7878&SecondYearInTaxesCancerApplicant1=0


This is a web app and I am using Html2pdf forge component to generate pdf. As the component is web and not offline I can't use the same so need help to make a pdf from Local Storage Entity. I have also tried PDFGeneratorPlugin. But it is also not helpful.


If Community Members can help me with an oml it will help me.

Regards,

Manthan Shah.

Hi Manthan,

If you want to create a PDF on mobile, you need a JavaScript PDF generator. We created one ourselves based on jsPDF, but that's not an out-of-the-box solution: we also created our own DOM translator.

Kilian Hekhuis wrote:

Hi Manthan,

If you want to create a PDF on mobile, you need a JavaScript PDF generator. We created one ourselves based on jsPDF, but that's not an out-of-the-box solution: we also created our own DOM translator.

How did you use jsPDF? Will it create pdf from Local Entity?


Hi Manthan,

"Create a PDF from Local Entity" doesn't make sense. You can't create a PDF from a database table. You create a PDF either from what's displayed on the Screen, or you create a PDF from scratch. What do you mean?

Kilian Hekhuis wrote:

Hi Manthan,

"Create a PDF from Local Entity" doesn't make sense. You can't create a PDF from a database table. You create a PDF either from what's displayed on the Screen, or you create a PDF from scratch. What do you mean?


Hi Killan,


Have you seen the link I shared from web app? The table which is created there is made from html table and the data filled in the table is coming from a list of records variable and I have used HTML2PDF Converter there so I want that to be done using offline entity having a variable as a List of that offline entity.


Regards,

Manthan Shah. 

Hi Manthan,

Once it's on the screen, it doesn't matter where the data came from. What's important, is that you want to create a PDF from HTML. I can share with you what we built, I think it should be possible for such a relatively straightforward HTML page to create an offline PDF with the tool I created. I need to check whether it has any ties with other Modules we created, so give me some time to prepare it. I'll probably post it to the Forge, I'll let you know.

EDIT: Are you on version 10 or 11?

Kilian Hekhuis wrote:

Hi Manthan,

Once it's on the screen, it doesn't matter where the data came from. What's important, is that you want to create a PDF from HTML. I can share with you what we built, I think it should be possible for such a relatively straightforward HTML page to create an offline PDF with the tool I created. I need to check whether it has any ties with other Modules we created, so give me some time to prepare it. I'll probably post it to the Forge, I'll let you know.

EDIT: Are you on version 10 or 11?

Hi Kilian,


I am using version 11. Thanks will wait for the oml.


Regards,

Manthan Shah.


Solution

Hi Manthan,

I've uploaded it to the Forge. You can download it here (or install it via Service Studio). There's a small example to show how to use it.

EDIT: But also see the description for some tips and pointers.

Solution

Kilian Hekhuis wrote:

Hi Manthan,

I've uploaded it to the Forge. You can download it here (or install it via Service Studio). There's a small example to show how to use it.

EDIT: But also see the description for some tips and pointers.

Hi Killan,


Thanks for sharing the component on forge will surely try it and let you know. If you can change the name of forge component to 'Mobile Offline PDF' it will be helpful for other member to search.


Regards,

Manthan Shah.

Ok, let me know if it works for you.

An alternative that I have successfully used is the component PDF Generator Plugin

Vincent Koning wrote:

An alternative that I have successfully used is the component PDF Generator Plugin

I have already used it but the component needs html to generate pdf which is not possible with local entity. So Killian solution would work. 


Kilian Hekhuis wrote:

Hi Manthan,

I've uploaded it to the Forge. You can download it here (or install it via Service Studio). There's a small example to show how to use it.

EDIT: But also see the description for some tips and pointers.

Cool it works.


Good to hear it works Manthan, happy coding!