我正在尝试将 Google 文档文件转换为 pdf。
我尝试按照“迁移到 Google Drive v3”中的建议,将 files.copy
方法与资源中的 mimeType
一起使用 documentation 。但它不起作用:它只进行简单的复制而不进行转换。看起来好像从未考虑 mimeType...
gapi.client.drive.files.copy({
name: 'My new PDF',
fileId: sourceId,
parents: [destinationId],
mimeType: 'application/pdf'
})
(注意:我正在尝试在浏览器中执行此操作)
我也尝试过“text/plain”,但也没有改变。
更新:
看起来复制方法期间的转换只能转换为 Google 特定的 mimeType(文档、工作表等)
最佳答案
我认为这相当gapi.client.drive.files.export :
gapi.client.drive.files.export({fileId: sourceId, mimeType: "application/pdf"});
关于node.js - Google Drive API v3 - 将 doc 转换为 pdf,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54622378/