# Plugin PDF generate

**URL:** <https://forum.kintone.dev/t/plugin-pdf-generate/47>\
**Category:** General\
**Created:** [September 21, 2017, 5:50am UTC](https://forum.kintone.dev/t/plugin-pdf-generate/47 "2017-09-21T05:50:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [September 21, 2017, 5:50am UTC](https://forum.kintone.dev/t/plugin-pdf-generate/47/1 "2017-09-21T05:50:24Z")

</div>

&nbsp;Hi,

I have a problem regarding PDF&nbsp;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&nbsp;record from the form I am currently in.

This plugin&nbsp;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&nbsp;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?

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [September 21, 2017, 9:07am UTC](https://forum.kintone.dev/t/plugin-pdf-generate/47/2 "2017-09-21T09:07:27Z")

</div>

HTML files seem&nbsp;not to be&nbsp;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);

&nbsp;

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

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [September 22, 2017, 1:51am UTC](https://forum.kintone.dev/t/plugin-pdf-generate/47/3 "2017-09-22T01:51:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [September 22, 2017, 2:51am UTC](https://forum.kintone.dev/t/plugin-pdf-generate/47/4 "2017-09-22T02:51:25Z")

</div>

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 🙂
