在 PHP 代碼中輕鬆合併 圖片 文件。這個 PHP 庫旨在使用 REST API 將多個 圖片 文件組合成一個文件,即通過 Internet 傳遞 HTTPS 調用。
這是一個專業的雲原生 圖片 合併解決方案,為 PHP 程序員提供了極大的開發靈活性和強大的功能。當需要創建一組具有相同結構的文檔時,通常使用將 圖片 文件連接在一起,每個文檔都包含唯一的數據。通過合併 圖片 文件,您可以自動化您的數字工作流程並將流程的一些常規部分卸載到快速高效的 圖片 處理 PHP 軟件。
在許多情況下,您可能需要將 圖片 文件組合在一起。例如,您可能希望在打印或歸檔之前將多個 圖片 文件組合在一起。
圖片 合併可以是整個集成文檔處理方法的一部分,用於從不同的數據源生成文檔。此類任務涉及使用功能齊全的 圖片 操作 PHP 庫,該庫將處理一組 圖片 文件並在盡可能短的時間內將它們合併在一起,從而產生緊湊而準確的結果。
要在 PHP 中合併 圖片,您至少需要兩個 圖片 源文件。如需快速入門,請查看下面的 PHP 代碼示例。
use Aspose\Words\WordsApi;
// 當前的 API 正在開發中。
$wordsApi = new WordsApi('####-####-####-####-####', '##################');
$document = "Input1.png";
$mergeProps = new ImageEntry(array(
"file_reference" => FileReference::fromRemoteFilePath("Input2.png"),
));
$imageEntries = [
$mergeProps,
];
$imageList = new ImageEntryList(array(
"image_entries" => $imageEntries,
));
$appendDocumentOnline = new AppendDocumentOnlineRequest(
$document, $imageList, NULL, NULL, NULL, NULL, NULL, NULL
);
$mergedImages = $wordsApi->appendDocumentOnline($appendDocumentOnline);
$convertDocument = new ConvertDocumentRequest(
$mergedImages, "png", NULL, NULL, NULL, NULL
);
$wordsApi->convertDocument($convertDocument);
從 Packagist 存儲庫安裝 'Aspose.Words Cloud SDK for PHP' 。只需運行 composer require aspose-cloud/aspose-words-cloud 來安裝 SDK,然後使用 require_once('vendor/autoload.php'); 將其導入您的項目。
作為替代方案,您可以從 GitHub 手動克隆 Aspose.Words Cloud SDK for PHP 源代碼。請按照這些 Instructions 快速獲取必要的安全憑證並訪問我們的 REST API。