Is it possible to generate PDF using jQuery?

后端 未结 6 764
忘掉有多难
忘掉有多难 2020-12-15 06:35

I am using Ajax functionality to retrieve my content and I need to export PDF on success of jQuery.ajax(). How can I do that?

6条回答
  •  猫巷女王i
    2020-12-15 06:53

    Add this to your Script:

    
    
    DocRaptor.createAndDownloadDoc("YOUR_API_KEY_HERE", {
        test: false, // test documents are free, but watermarked
        type: "pdf",
        name: planStatus+"_" +assessmentYear+"_"+employeeId+ ".pdf",
        document_content: document.querySelector('#MyDoc').innerHTML, // use this page's HTML
        // document_content: "

    Hello world!

    ", // or supply HTML directly // document_url: "http://example.com/your-page", // or use a URL // javascript: true, // enable JavaScript processing // prince_options: { // media: "screen", // use screen styles instead of print styles // } })

提交回复
热议问题