Is there any way to center text with jsPDF?

前端 未结 9 1197
半阙折子戏
半阙折子戏 2021-02-01 02:07

I\'m trying to create a simple pdf doc using javascript. I found jsPDF but I don\'t figure out how to center text. Is it possible?

9条回答
  •  [愿得一人]
    2021-02-01 02:54

    WootWoot, just in case you need more layout options, you could also take a look at my pdfmake library

    It supports:

    • text alignments, lists, margins
    • styling (with style inheritance)
    • tables with auto/fixed/star sized columns, auto-repeated headers, col/row spans
    • page headers and footers
    • font embedding, and a couple of other options

    It works on client-side (pure JS) or server-side (an npm module)

    Take a look at the playground to see what's possible

    Good luck

提交回复
热议问题