The Zurich release has arrived! Interested in new features and functionalities? Click here for more

jsPDF is taking too much time to generate PDF

sreevishnu
Tera Contributor

I need to generate a pdf dynamically from servicenow cms site, according   to the users request i will be fetching the data using the GlideRecord and will convert the response to PDF.Currently i am using jsPDF to generate the pdf. While generating the pdf i will be adding some graphical images for the introduction page and header/footer for the remaining pages. This works fine if the total number of page is less, but if the total number of page is more than 200 its taking too much time to generate the pdf. I will be generating pdf for thousands of pages

Is there any other option to dynamically generate the pdf according to users request(should have features to add images,header,footer,text size,font etc to the pages)

or else is there any way to generate a customized pdf from the server side itself, currently i have written the code in UI Macro.

2 REPLIES 2

bernyalvarado
Mega Sage

Hi,



jsPDF runs on the client side, right? Is there a way to run it as a service online? If there is, then you may want to execute your PDF conversion at the server side.


If isPDF only runs on the client side, you could have a "fake client" server where you interact with ServiceNow through any system that automates "Web browser calls" (like Selenium) and automatically generate the PDFs as per a client request or a given condition.



Thanks,


Berny


bernyalvarado
Mega Sage

I perhaps should have added, if you want a reliable and scalable solution to generate thousands of PDF pages per document, almost for sure you should be looking to do as much as processing as possible on the server side (or through a "fake - batch based client" pdf generator)



Thanks,


Berny