javascript - How to create PDF document from HTML table? -


i'm using angularjs data api , populate html table using ng-repeat.

table populated array containing json arrays data (eg. vm.data = [{"x": 1, "y":2}, {"x": 1, "y":2}...])

html table customized using external stylesheet file.

i want create pdf file html table , possible div containing data table (like header). preferably done without jquery, using pure js , angularjs. table in pdf should include stylesheet info (font, font-size, color, child background...).

one thing notice table have limited height, scrollable on x axis (using overflow:auto). want table shown in pdf file full height.


methods tried:

jspdf - not customizable tables
html-pfg (https://www.npmjs.com/package/html-pdf) - not customizable tables/bad documentation
(is there angular way of printing div html page?) - hackish/uses jquery
(print div using javascript in angularjs single page application) - not applying css files
(https://github.com/sayanee/angularjs-pdf) - not plugin creating pdf documents...
pdfmake
(generate pdf html using pdfmake in angularjs) - not working because part of table shown on page , scrollable. want full table in pdf.

i managed create pdf reports needed.

plugin used pdfmake , best found, works flawless.

only problem had wrongly included , that's why didn't worked first time.


Comments