我正在使用Google Drive v3并尝试将 Google 电子表格文件导出为 PDF。几乎一切都按预期进行。
例外:
生成的 PDF 始终采用LETTER和PORTRAIT格式,但我需要DIN A4和横向格式的 pdf 。我无法找到任何设置/参数来提交到 v3 以生成其他格式的 PDF。
我找到了适用于 Google Drive v2 的解决方案,但没有找到适用于 Google Drive v3 的解决方案。
将格式或肖像作为可选参数传递会导致错误:-(
/**
* Downloads a Google file in a specified mime type.
*
* @param string $googleDriveFileId id of the drive file which should be downloaded
* @param string $mimeType mime type
* @param string[] $optParams
*
* @return Response
*
* …Run Code Online (Sandbox Code Playgroud)