1

I am using jspdf to convert a webpage into a pdf document and I have the from_html plugin included. It converts all the tables in my document and everything is fine except I would really like to change the way to tables look. They all have a dark grey head and the text is bold and too large. I can't work out how to change them.

Things I have tried:

  • Setting the color and size inside the td tag
  • Changing the doc.table_font_size to a smaller number before doc.save
  • Searching through the js files to try to find where they are set

Can anyone tell me what I haven't tried or if this is even possible please? All of the demos of tables made with jspdf seem to look the same as mine but I would really like to change it.

Thank you!

James

jperry1147
  • 276
  • 2
  • 13

1 Answers1

0

You have tried:

  • Setting the color and size inside the td tag

Unfortunately jsPDF doesn't seem to support CSS - see this answer.

  • Changing the doc.table_font_size to a smaller number before doc.save

Have you tried using doc.setFontSize(size)?

  • Searching through the js files to try to find where they are set

Here is the debug file - much handier to search through.

I know this isn't a direct solution to what you're trying to do, but I hope it helps a little bit - I just started learning how to use jsPDF too, but I'm building tables from scratch rather than trying to export them from the HTML.

Community
  • 1
  • 1
Villager
  • 604
  • 6
  • 15
  • Thank you. In the end I have also adding the tables manually which did allow me to change the Drawcolor etc. It works OK and together with images etc I have ended up with an entire Walker which deals with lots of elements. Happy to share code if you need it! Thanks again! – jperry1147 Jan 20 '15 at 12:36