Generating PDF files with JavaScript

后端 未结 6 1124
悲哀的现实
悲哀的现实 2020-11-22 05:45

I’m trying to convert XML data into PDF files from a web page and I was hoping I could do this entirely within JavaScript. I need to be able to draw text, images and simple

6条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-22 06:49

    Even if you could generate the PDF in-memory in JavaScript, you would still have the issue of how to transfer that data to the user. It's hard for JavaScript to just push a file at the user.

    To get the file to the user, you would want to do a server submit in order to get the browser to bring up the save dialog.

    With that said, it really isn't too hard to generate PDFs. Just read the spec.

提交回复
热议问题