[英]How to get the file URL uploaded in google drive SDK using php
[英]How to create file pdf file in google drive sdk using php
我正在使用Google Drive sdk创建pdf文件,但在创建文件时出现错误。我无法下载该文件。
这是我创建pdf文件时的php代码:
$subcontent = "<h1>Hello World</h1><p>text here of some</p>";
$file = new Google_DriveFile();
$file->setTitle( $fileName );
$file->setDescription( $description );
$mkFile = $this->_service->files->insert($file, array('data' => $subcontent, 'mimeType' => 'application/pdf'));
该文件不能下载或打印。
该文件的底部还显示错误,提示“ Opps! There was a problem loading more pages
Opps! There was a problem loading more pages
有人可以帮助我吗? 一个星期以来,我一直在努力。.在此先感谢您的帮助。
您似乎已经假设云端硬盘会将您的HTML文件转换为PDF文件。 不会的 。
您可以执行以下操作:让云端硬盘将HTML转换为Google文档,然后将该文档导出为PDF。 将您的mime类型更改为text/html
并添加convert=true
(有关方法,请参阅库文档)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.