Nested tables in a pdf using jspdf and jspdf-autotable - jspdf

How to achieve nested tables in a PDF using jspdf and jspadf-autotable? Something similar to the picture below:

Check this approach, together with html template and autotable . Created in StackBlitz

Related

Show head only for first page in jspdf-autotable 3.1.1

I am using jspdf-autotable for generating pdf report. I want the header text will only be shown for the first page but not working when setting this option showHead: 'firstPage'
For example: Here is a jsfiddle
Can anyone help me?
The showHead option is for the table header and will not affect the hooks. If you want to have the same behavior for the hooks you can check the data parameter data.pageNumber and conditionally draw your content base on it.

Generating pdf, getting text from ckeditor in rails admin

I've created a form with several fields, and many of them use ckeditor, I know that separately I can generate a pdf of each field, but I have normal fields (string, date), and I wanted them to be in pdf. I tried with the prawn but it does not render the ckeditor html tags. How to generate a pdf with these fields, those of the ckeditor rendering the html tags, and the others appearing normally?
Use the following command to process the following html tags present in the ckeditor for prawn to understand:
ActionView::Base.full_sanitizer.sanitize(#string)

Unable to insert CheckBox in a pdf using jsPdf

I am fallowing the link bellow,
http://fiddle.jshell.net/NishitDhakar/ugD5L/
I am able to create tables on pdf, but when I include checkbox, the checkbox is not printing on the pdf.
Any help ?

Usage of html_safe attribute in Prawn PDF syntax

I'm rendering the PDF data from the output of CK editor (What you see is what you get editor).
The output from that editor would be included with all the HTML, CSS tags in the content. For that I had used 'html_safe' attribute in the show page. But when I try to use the same attribute in the PDF prawn syntax its not working. Can someone please guide me how to get the pure content without all the HTML tags in Prawn PDF?
Thanks in advance.
After a long a Google search I finally got an answer which I wish to share with you.
As html_safe is the action view method in rails, It can not be used in ruby syntax of Prawn pdf.
So for that we can use:
ActionView::Base.full_sanitizer.sanitize(#string)
http://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-strip_tags

HTML with Prawn

Im trying to use prawn to generate a PDF of a log entry, then entries are stored in bbcode ([b]bold[/b] etc...) and is converted to html on display.
Is there any way to display the html in prawn?
It sounds like prawn-format might be what you're looking for, but you'll need to use an older version of prawn if you want to try it out.
You'll probably get the best results if you use a lexical analyser such as 'Syntax' by Jamis Buck (http://syntax.rubyforge.org/) and parse the interesting parts of the HTML chunk and render those parts to PDF.
You can use http://www.princexml.com/ to convert html docs to css, or use the princely plugin to render a pdf as one of the accepted formats of your view. See http://jimneath.org/2009/02/16/creating-pdf-documents-in-ruby-on-rails/
If you are wanting to use prawn directly I don't think there is a way to just use html directly to convert to pdf.

Resources