Plugin PDF generate

 Hi,

I have a problem regarding PDF preview, i don’t want the pdf preview to be on the kintone forms itself but i wanted it to be on another page.

Detailed Explanation:

  1. I created a plugin that will get the record on the current view
  2. That plugin inserts a button to the form, the button is called “Print”
  3. What I wanted to print is the data from the current form
  4. That print button should have a function that will redirect me to another page
  5. That PDF preview page should have the record from the form I am currently in.

This plugin is like RepotoneU PDF plugin but instead of attachment field being the one giving the template for the report or the pdf preview I wanted it to be from scratch and I just wanted to pass the data from the record

I have tried creating another html file from the html folder of my plugin but I can’t seem to call the html file from my javascript file. I’ve tried using jspdf.js but this library needs an html file in order to generate the required pdf and it auto downloads the html to pdf. what I wanted is a preview first of the pdf and create the design from scratch.

If there is a way that I can use this library then it would be better for the development of our project, but if not then is there a solution for this?

HTML files seem not to be loaded on the desktop side. I guess it is good to try appending hidden HTML elements with javascript like this.

var html=

‘<div id=“container” style=“display:none;”>’ +

’ <span>Title</span>’ +

‘</div>’;

$(kintone.app.record.getHeaderMenuSpaceElement()).html(html);

 

BTW, I think that it is better to hide the domain or any other users’ information when you post here.

German, we have edited the pics in your post to hide the URLs for security reasons (as Ryu has pointed out)

Sorry for the information leak.

BTW thank you for the reply, i’ll try it out and respond ASAP when i’m done, thank you :slight_smile: