如何在使用 convertapi 将 xlsx 转换为 pdf 之前 select 范围

How to select range before convert xlsx to pdf using convertapi

使用convertapi,我想设置范围并仅将选定区域转换为pdf。这可能吗?

<?php
require_once('vendor/autoload.php');
require_once 'vendor/convertapi/convertapi- 
php/lib/ConvertApi/ConvertApi.php';
use \ConvertApi\ConvertApi;
ConvertApi::setApiSecret('secret');
$result = ConvertApi::convert('pdf', [
    'File' => 'output/spreadsheet_2.xlsx',
], 'xlsx'
);
$result->saveFiles('output');
?>

提前致谢。

目前您只能设置 WorksheetNameWorksheetIndex 参数来缩小要转换的范围。

如果要转换 sheet 的范围,您只能在该范围上循环,每次从一个 sheet 转换一个单独的 PDF。 到现在为止没有更好的选择。