Skip to content

Instantly share code, notes, and snippets.

@kaferi
Last active February 16, 2022 17:04
PostSplitDocument-php
// For complete examples and data files, please go to https://github.com/aspose-pdf-cloud/aspose-pdf-cloud-php
<?php
$fileName = "myFile.pdf";
$remoteFolder = "storageFiles";
$localFolder = "../localFiles";
$localPath = $localFolder . "/" . $fileName;
$remotePath = $remoteFolder . "/" . $fileName;
$storage = null;
$format = "pdf";
$pageFrom = 2;
$pageTo = 3;
$configuration = new Configuration();
$configuration->setAppKey("API_KEY");
$configuration->setAppSid("APP_ID");
$pdfApi = new PdfApi(null, $configuration);
$file = realpath(__DIR__ . "/" . $localPath);
$result = $pdfApi->uploadFile($path = $remotePath, $file);
$response = $pdfApi->postSplitDocument($fileName, $format = $format, $from = $pageFrom, $to = $pageTo, $storage = null, $remoteFolder);
print_r ($response);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment