如何使用 CloudConvert API 和 PHP SDK 将转换下载为多个文件?
How to use CloudConvert API with PHP SDK to download a conversion as multiple files?
我正在尝试使用 CloudConvert API 和 PHP 将 PDF 转换为 HTML 并且它有效,但到目前为止我只能收到 html 文件html 文件中嵌入了所有资产(img、css、js、字体)。我希望能够将资产作为单独的文件下载,可以是 zip 文件,也可以是单独的文件,并且他们的 Web 界面允许这样做,但我正在努力使用 API/SDK.[=15 使其工作=]
感谢任何帮助!
我的代码如下所示:
$process = $api->createProcess([
"inputformat" => "pdf",
"outputformat" => "html",
]);
$process->start([
"input"=>"download",
"file"=>$pdf_url,
"outputformat" => "html",
"converteroptions" => [
"zoom" => 1,
"page_width" => 900,
"page_height" => 1100,
"embed_css" => [],
"embed_font" => [],
"embed_javascript" => [],
"embed_image" => [],
],
])->wait();
$process->downloadAll($download_dir);
选项embed_javascript
、embed_css
等为布尔值:
$process->start([
"input"=>"download",
"file"=>$pdf_url,
"outputformat" => "html",
"converteroptions" => [
"embed_css" => false,
"embed_font" => false,
"embed_javascript" => false,
"embed_image" => false,
],
])->wait();
我正在尝试使用 CloudConvert API 和 PHP 将 PDF 转换为 HTML 并且它有效,但到目前为止我只能收到 html 文件html 文件中嵌入了所有资产(img、css、js、字体)。我希望能够将资产作为单独的文件下载,可以是 zip 文件,也可以是单独的文件,并且他们的 Web 界面允许这样做,但我正在努力使用 API/SDK.[=15 使其工作=] 感谢任何帮助! 我的代码如下所示:
$process = $api->createProcess([
"inputformat" => "pdf",
"outputformat" => "html",
]);
$process->start([
"input"=>"download",
"file"=>$pdf_url,
"outputformat" => "html",
"converteroptions" => [
"zoom" => 1,
"page_width" => 900,
"page_height" => 1100,
"embed_css" => [],
"embed_font" => [],
"embed_javascript" => [],
"embed_image" => [],
],
])->wait();
$process->downloadAll($download_dir);
选项embed_javascript
、embed_css
等为布尔值:
$process->start([
"input"=>"download",
"file"=>$pdf_url,
"outputformat" => "html",
"converteroptions" => [
"embed_css" => false,
"embed_font" => false,
"embed_javascript" => false,
"embed_image" => false,
],
])->wait();