jsPdf generator

This thread was migrated from an old forum. It may contain information that are no longer valid. For further assistance, please post a new question or open a support ticket from the Customer Support portal.

How open the file generated using the jsPdf

can you please help here? Thanks!

PDF Generator Component in marketplace provides two API's to generate PDF

  1. generatePdfUsingDom() takes Visualizer Web FormName_FlexName as input and generates PDF
  2. generatePdfUsingHtmlString() takes HTML string as input and generates PDF

For more information about the component, Please check the component "How to" section in below mentioned URL

https://marketplace.kony.com/items/pdf-generator-jspdf

Let us if you face any issues.

Hi Team,

Thanks for your quick response. Can you please help in answering below questions.

  1. After generating the PDF using generatePdfUsingHtmlString how can I render it?
  2. How to include images in my HTML content?

@Hvwwiett Hvwt​ if you have your pdf content in html format, you can pass string form of the same to generatePdfUsingHtmlString as an argument.

Example snippet

//if pdf content is in the html page as follows /* <html> <head> <title>Enter a title, displayed at the top of the window.</title> </head> <!-- The information between the BODY and /BODY tags is displayed.--> <body> <h1>Enter the main heading, usually the same as the title.</h1> <p>Be <b>bold</b> in stating your key points. Put them in a list: </p> <ul> <li>The first item in your list</li> <li>The second item; <i>italicize</i> key words</li> </ul>

Break up your page with a horizontal rule or two. </p>
<hr>

<!-- And add a copyright notice.–>
<p>&#169; Wiley Publishing, 2011</p>
</body>
</html>
*/

//string form of above html is

var htmlstring = ‘<html>’+
‘<head>’+
‘<title>Enter a title, displayed at the top of the window.</title>’+
‘</head>’+
‘<!-- The information between the BODY and /BODY tags is displayed.–>’+
‘<body>’+
‘<h1>Enter the main heading, usually the same as the title.</h1>’+
‘<p>Be <b>bold</b> in stating your key points. Put them in a list: </p>’+
‘<ul>’+
‘<li>The first item in your list</li>’+
‘<li>The second item; <i>italicize</i> key words</li>’+
‘</ul>’+
‘’+
‘Break up your page with a horizontal rule or two. </p>’+
‘<hr>’+
‘’+
‘<!-- And add a copyright notice.–>’+
‘<p>© Wiley Publishing, 2011</p>’+
‘</body>’+
‘</html>’;

/you can simple generate pdf by just invoking pdfgenerator component’s generatePdfUsingHtmlString api by passing string form of html as follows/

this.view.pdfgenerator.generatePdfUsingHtmlString(htmlstring);

@Hvwwiett Hvwt​ pdf will generated/downloaded with required content, there is no need to render it again

Hi Team, Thanks for the prompt response, We have a business requirement after generating the PDF open in the default PDF viewer. Regards

Hi,

are you able to view pdf after generation using pdfgenerator component?

I am also looking for same solution, could you please help me if you got the solution.

@Divnv Skinnew​

Could you look into it?