Merge Multiple PDF's into one PDF

后端 未结 6 725
一整个雨季
一整个雨季 2020-11-30 10:36

I am having some issues with my code. I am trying to loop through a Drive folder that contains many PDFs and then merge these into one file. When I use my code it just creat

6条回答
  •  遥遥无期
    2020-11-30 11:22

    The .getBytes() method returns a binary array for each file, so what you're created is an array of arrays with:

    blobs.push(files[i].getBlob().getBytes());
    

    Instead, I'd concatenate the array for the current item in the loop with an accumulator array that grows with each loop iteration. Then, after exiting the loop the contents of the accumulator array can be passed into .newBlob() or .setBytes()

提交回复
热议问题