Exported PDF is blank if merge and export functions are run from the same Apps Script function

前端 未结 1 1046
闹比i
闹比i 2020-12-07 06:03

I have code that combines several Google Docs into one file, and code to save a Doc as PDF:

function createPDF(docId) {
  var docFile = DriveApp.getFileById(         


        
相关标签:
1条回答
  • 2020-12-07 06:31

    I think that happening because you're not saving and closing the docs.

    Check this out https://developers.google.com/apps-script/reference/document/document#saveandclose

    And try closing your doc at the end of the mergeDocuments function.

    tehhowch have explained this in comment also, some credit goes to him too. :)

    0 讨论(0)
提交回复
热议问题