Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
The GIST contains PHP code snippets for examples of Aspose.Pdf for Cloud.
Aspose.Pdf-for-Cloud-for-PHP
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Annotation {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function getPageAnnotation() {
// Upload file to Aspose Cloud Storage
$fileName = "Sample-Annotation.pdf";
Utils::uploadFile($fileName);
$result = $this->pdfApi->GetPageAnnotation($fileName, $pageNumber = 1, $annotationNumber = 1, $storage = "", $folder = "");
print_r ( $result );
}
}
$annotation = new Annotation();
$annotation->getPageAnnotation();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Annotation {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function getPageAnnotations() {
// Upload file to Aspose Cloud Storage
$fileName = "Sample-Annotation.pdf";
Utils::uploadFile($fileName);
$result = $this->pdfApi->GetPageAnnotations($fileName, $pageNumber = 1, $storage = "", $folder = "");
print_r ( $result );
}
}
$annotation = new Annotation();
$annotation->getPageAnnotations();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Attachment {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function getDocumentAttachmentByIndex() {
// Upload file to Aspose Cloud Storage
$fileName = "SampleAttachment.pdf";
Utils::uploadFile($fileName);
$result = $this->pdfApi->GetDocumentAttachmentByIndex($name=$fileName, $attachmentIndex=1, $storage = "", $folder = "");
print_r ( $result );
}
}
$attachment = new Attachment();
$attachment->getDocumentAttachmentByIndex();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Attachment {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function getDocumentAttachments() {
// Upload file to Aspose Cloud Storage
$fileName = "SampleAttachment.pdf";
Utils::uploadFile($fileName);
$result = $this->pdfApi->GetDocumentAttachments($fileName, $storage = "", $folder = "");
print_r ( $result );
}
}
$attachment = new Attachment();
$attachment->getDocumentAttachments();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Attachment {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function getDownloadDocumentAttachmentByIndex() {
// Upload file to Aspose Cloud Storage
$fileName = "SampleAttachment.pdf";
Utils::uploadFile($fileName);
$result = $this->pdfApi->GetDownloadDocumentAttachmentByIndex($name=$fileName, $attachmentIndex=1, $storage = "", $folder = "");
print_r ( $result );
}
}
$attachment = new Attachment();
$attachment->getDownloadDocumentAttachmentByIndex();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Bookmark {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function getDocumentBookmarks() {
// Upload file to Aspose Cloud Storage
$fileName = "Sample-Bookmark.pdf";
Utils::uploadFile($fileName);
$result = $this->pdfApi->GetDocumentBookmarks($fileName, $storage = "", $folder = "");
print_r ( $result );
}
}
$bookmark = new Bookmark();
$bookmark->getDocumentBookmarks();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Bookmark {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function getDocumentBookmarksChildren() {
// Upload file to Aspose Cloud Storage
$fileName = "Sample-Bookmark.pdf";
Utils::uploadFile($fileName);
$result = $this->pdfApi->GetDocumentBookmarksChildren($name = $fileName, $bookmarkPath = "1", $storage = "", $folder = "");
print_r ( $result );
}
}
$bookmark = new Bookmark();
$bookmark->getDocumentBookmarksChildren();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Document {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function createNewDocument() {
// Upload file to Aspose Cloud Storage
$fileName = "newPDFFile.pdf";
$result = $this->pdfApi->PutCreateDocument($fileName, $templateFile = null, $dataFile = null, $templateType = null, $storage = "", $folder = "");
print_r ( $result );
}
}
$document = new Document();
$document->createNewDocument();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Document {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function createPDFFromHTML() {
// Upload file to Aspose Cloud Storage
$fileName = "newPDFFromHTML.pdf";
$templateFile = "sample.html";
Utils::uploadFile($templateFile);
$result = $this->pdfApi->PutCreateDocument($fileName, $templateFile, $dataFile = null, $templateType = "html", $storage = "", $folder = "");
print_r ( $result );
}
}
$document = new Document();
$document->createPDFFromHTML();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Document {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function createPDFFromJPEG() {
// Upload file to Aspose Cloud Storage
$fileName = "sample-jpeg.pdf";
$templateFile = "Einstein_JPEG.jpg";
Utils::uploadFile($templateFile);
$result = $this->pdfApi->PutCreateDocument($fileName, $templateFile, $dataFile = null, $templateType = "jpeg", $storage = "", $folder = "");
print_r ( $result );
}
}
$document = new Document();
$document->createPDFFromJPEG();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Document {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function createPDFFromSVG() {
// Upload file to Aspose Cloud Storage
$fileName = "sample-svg.pdf";
$templateFile = "Example.svg";
Utils::uploadFile($templateFile);
$result = $this->pdfApi->PutCreateDocument($fileName, $templateFile, $dataFile = null, $templateType = "svg", $storage = "", $folder = "");
print_r ( $result );
}
}
$document = new Document();
$document->createPDFFromSVG();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Document {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function createPDFFromTIFF() {
// Upload file to Aspose Cloud Storage
$fileName = "sample-tiff.pdf";
$templateFile = "Sample.tiff";
Utils::uploadFile($templateFile);
$result = $this->pdfApi->PutCreateDocument($fileName, $templateFile, $dataFile = null, $templateType = "tiff", $storage = "", $folder = "");
print_r ( $result );
}
}
$document = new Document();
$document->createPDFFromTIFF();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Document {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function createPDFFromXML() {
// Upload file to Aspose Cloud Storage
$fileName = "newPDFFromXML.pdf";
$templateFile = "sample.xsl";
$dataFile = "sample.xml";
Utils::uploadFile($templateFile);
Utils::uploadFile($dataFile);
$result = $this->pdfApi->PutCreateDocument($fileName, $templateFile, $dataFile, $templateType = "xml", $storage = "", $folder = "");
print_r ( $result );
}
}
$document = new Document();
$document->createPDFFromXML();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Document {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function getDocumentWithFormat() {
// Upload file to Aspose Cloud Storage
$fileName = "LargeFile.pdf";
//Utils::uploadFile($fileName);
$result = $this->pdfApi->GetDocumentWithFormat($fileName, $format = "doc", $storage = "", $folder = "", $outPath = "");
print_r ( $result );
}
}
$document = new Document();
$document->getDocumentWithFormat();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Document {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function postAppendDocument() {
// Upload file to Aspose Cloud Storage
$fileName = "Sample.pdf";
Utils::uploadFile($fileName);
$append_file_name = "sample-input.pdf";
Utils::uploadFile($append_file_name);
$body = array("Document"=>$append_file_name);
$result = $this->pdfApi->PostAppendDocument($fileName, $appendFile = "", $startPage = 2, $endPage = 3, $storage = "", $folder = "", $body);
print_r ( $result );
}
}
$document = new Document();
$document->postAppendDocument();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Document {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function postSignPage() {
// Upload file to Aspose Cloud Storage
$fileName = "sample-input.pdf";
Utils::uploadFile($fileName);
$signatureFileName = "pkc7-sample.pfx";
Utils::uploadFile($signatureFileName);
$body = '{
"SignaturePath": "pkc7-sample.pfx",
"SignatureType": "PKCS7",
"Password": "aspose",
"Reason": "Success",
"Contact": "alexey@aspose.com",
"Location": "London",
"Visible": true,
"Rectangle": {
"X": 100,
"Y": 100,
"Width": 200,
"Height": 100
},
"FormFieldName": "Signature1",
"Authority": "Alexey",
"Date": "10/25/2015 2:46:00.000 PM"
}';
$result = $this->pdfApi->PostSignPage($fileName, $pageNumber = 1, $storage = "", $folder = "", $body);
print_r ( $result );
}
}
$document = new Document();
$document->postSignPage();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Document {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function postSplitDocument() {
// Upload file to Aspose Cloud Storage
$fileName = "sample-input.pdf";
Utils::uploadFile($fileName);
$result = $this->pdfApi->PostSplitDocument($fileName, $format = "pdf", $from = 1, $to = 2, $storage = "", $folder = "");
print_r ( $result );
}
}
$document = new Document();
$document->postSplitDocument();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Document {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function putConvertDocument() {
$file = realpath(__DIR__ . '/../../..') . '/Data/Sample.pdf';
$result = $this->pdfApi->PutConvertDocument($format = "tiff", $url = "", $outPath = "", $file);
$fh = fopen(realpath(__DIR__ . '/../../..') . '/Data/Output/Test.tiff', 'w');
fwrite($fh, $result);
fclose($fh);
}
}
$document = new Document();
$document->putConvertDocument();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Document {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function putMergeDocuments() {
$fileName = "sample-merged.pdf";
// Upload file to Aspose Cloud Storage
$fileName1 = "Sample.pdf";
Utils::uploadFile($fileName);
$fileName2 = "sample-input.pdf";
Utils::uploadFile($fileName1);
$body = array('List' => array($fileName1, $fileName2));
$result = $this->pdfApi->PutMergeDocuments($fileName, $storage = "", $folder = "", $body);
print_r ( $result );
}
}
$document = new Document();
$document->putMergeDocuments();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class DocumentProperties {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function deleteProperties() {
// Upload file to Aspose Cloud Storage
$fileName = "Sample-Annotation.pdf";
Utils::uploadFile($fileName);
$result = $this->pdfApi->DeleteProperties($fileName, $storage = "", $folder = "");
print_r ( $result );
}
}
$documentProperties = new DocumentProperties();
$documentProperties->deleteProperties();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class DocumentProperties {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function getDocumentProperties() {
// Upload file to Aspose Cloud Storage
$fileName = "Sample-Annotation.pdf";
Utils::uploadFile($fileName);
$result = $this->pdfApi->GetDocumentProperties($fileName, $storage = "", $folder = "");
print_r ( $result );
}
}
$documentProperties = new DocumentProperties();
$documentProperties->getDocumentProperties();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class DocumentProperties {
public pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function getDocumentProperty() {
// Upload file to Aspose Cloud Storage
$fileName = "sample-input.pdf";
Utils::uploadFile($fileName);
$result = $this->pdfApi->GetDocumentProperty($fileName, $propertyName = "Author", $storage = "", $folder = "");
print_r ( $result );
}
}
$documentProperties = new DocumentProperties();
$documentProperties->getDocumentProperty();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class DocumentProperties {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function putSetProperty() {
$fileName = "Sample-Annotation.pdf";
$body = array('Value' => 'Mike');
$result = $this->pdfApi->PutSetProperty($fileName, $propertyName = "author", $storage = "", $folder = "", $body);
print_r ( $result );
}
}
$documentProperties = new DocumentProperties();
$documentProperties->putSetProperty();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class FormField {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function getField() {
// Upload file to Aspose Cloud Storage
$fileName = "sample-field.pdf";
Utils::uploadFile($fileName);
$result = $this->pdfApi->GetField($fileName, $fieldName = "textbox1", $storage = "", $folder = "");
print_r ( $result );
}
}
$formField = new FormField();
$formField->getField();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class FormField {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function getFields() {
// Upload file to Aspose Cloud Storage
$fileName = "sample-field.pdf";
Utils::uploadFile($fileName);
$result = $this->pdfApi->GetFields($fileName, $storage = "", $folder = "");
print_r ( $result );
}
}
$formField = new FormField();
$formField->getFields();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class FormField {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function putUpdateField() {
// Upload file to Aspose Cloud Storage
$fileName = "sample-field.pdf";
Utils::uploadFile($fileName);
$body = array("Name" => "textbox1", "Values" => array("Aspose"));
$result = $this->pdfApi->PutUpdateField($fileName, $storage = "", $folder = "", $fieldName = "textbox1", $body);
print_r ( $result );
}
}
$formField = new FormField();
$formField->putUpdateField();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Images {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function getImages() {
// Upload file to Aspose Cloud Storage
$fileName = "SampleImage.pdf";
Utils::uploadFile($fileName);
$result = $this->pdfApi->GetImages($fileName, $pageNumber = 1, $storage = "", $folder = "");
print_r ( $result );
}
}
$images = new Images();
$images->getImages();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Images {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function getImageWithFormat() {
// Upload file to Aspose Cloud Storage
$fileName = "SampleImage.pdf";
Utils::uploadFile($fileName);
$result = $this->pdfApi->GetImageWithFormat($fileName, $pageNumber=1, $imageNumber=1, $format="jpeg", $width = 100, $height = 100, $storage = "", $folder = "");
$fh = fopen(realpath(__DIR__ . '/../../..') . '/Data/Output/Test.png', 'w');
fwrite($fh, $result);
fclose($fh);
}
}
$images = new Images();
$images->getImageWithFormat();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Images {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function postReplaceImage() {
// Upload file to Aspose Cloud Storage
$fileName = "SampleImage.pdf";
Utils::uploadFile($fileName);
$file = realpath(__DIR__ . '/../../..') . '/Data/aspose-cloud.png';
$result = $this->pdfApi->PostReplaceImage($fileName, $pageNumber = 1, $imageNumber = 1, $imageFile = "", $storage = "", $folder = "", $file);
print_r ( $result );
}
}
$images = new Images();
$images->postReplaceImage();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Pages {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function getPageWithFormat() {
// Upload file to Aspose Cloud Storage
$fileName = "Sample-Annotation.pdf";
Utils::uploadFile($fileName);
$result = $this->pdfApi->GetPageWithFormat($fileName, $pageNumber=1, $format="png", $width = 300, $height = 300, $storage = "", $folder = "");
$fh = fopen(realpath(__DIR__ . '/../../..') . '/Data/Output/Test.gif', 'w');
fwrite($fh, $result);
fclose($fh);
}
}
$pages = new Pages();
$pages->getPageWithFormat();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Pages {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function deletePage() {
// Upload file to Aspose Cloud Storage
$fileName = "sample-input.pdf";
Utils::uploadFile($fileName);
$result = $this->pdfApi->DeletePage($fileName, $pageNumber=1, $storage = "", $folder = "");
print_r ( $result );
}
}
$pages = new Pages();
$pages->deletePage();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Pages {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function getPageWithFormat() {
// Upload file to Aspose Cloud Storage
$fileName = "Sample-Annotation.pdf";
Utils::uploadFile($fileName);
$result = $this->pdfApi->GetPageWithFormat($fileName, $pageNumber=1, $format="png", $width = null, $height = null, $storage = "", $folder = "");
$fh = fopen(realpath(__DIR__ . '/../../..') . '/Data/Output/Test.gif', 'w');
fwrite($fh, $result);
fclose($fh);
}
}
$pages = new Pages();
$pages->getPageWithFormat();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Pages {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function getPages() {
// Upload file to Aspose Cloud Storage
$fileName = "Sample-Annotation.pdf";
Utils::uploadFile($fileName);
$result = $this->pdfApi->GetPages($fileName, $storage = "", $folder = "");
print_r ( $result );
}
}
$pages = new Pages();
$pages->getPages();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Pages {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function postMovePage() {
// Upload file to Aspose Cloud Storage
$fileName = "sample-merged.pdf";
Utils::uploadFile($fileName);
$result = $this->pdfApi->PostMovePage($fileName, $pageNumber = 1, $newIndex = 1, $storage = "", $folder = "");
print_r ( $result );
}
}
$pages = new Pages();
$pages->postMovePage();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Pages {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function putAddNewPage() {
// Upload file to Aspose Cloud Storage
$fileName = "sample-input.pdf";
Utils::uploadFile($fileName);
$result = $this->pdfApi->PutAddNewPage($fileName, $storage = "", $folder = "");
print_r ( $result );
}
}
$pages = new Pages();
$pages->putAddNewPage();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Text {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function getFragment() {
// Upload file to Aspose Cloud Storage
$fileName = "sample-input.pdf";
Utils::uploadFile($fileName);
$result = $this->pdfApi->GetFragment($fileName, $pageNumber = 1, $fragmentNumber = 1, $withEmpty = "", $storage = "", $folder = "");
print_r ( $result );
}
}
$text = new Text();
$text->getFragment();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Text {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function getFragments() {
// Upload file to Aspose Cloud Storage
$fileName = "sample-input.pdf";
Utils::uploadFile($fileName);
$result = $this->pdfApi->GetFragments($fileName, $pageNumber = 1, $withEmpty = "", $storage = "", $folder = "");
print_r ( $result );
}
}
$text = new Text();
$text->getFragments();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Text {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function getFragmentTextFormat() {
// Upload file to Aspose Cloud Storage
$fileName = "sample-input.pdf";
Utils::uploadFile($fileName);
$result = $this->pdfApi->GetFragmentTextFormat($fileName, $pageNumber = 1, $fragmentNumber = 1, $storage = "", $folder = "");
print_r ( $result );
}
}
$text = new Text();
$text->getFragmentTextFormat();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Text {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function getPageTextItems() {
// Upload file to Aspose Cloud Storage
$fileName = "Sample-Annotation.pdf";
Utils::uploadFile($fileName);
$result = $this->pdfApi->GetPageTextItems($fileName, $pageNumber = 1, $withEmpty = "", $storage = "", $folder = "");
print_r ( $result );
}
}
$text = new Text();
$text->getPageTextItems();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Text {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function getSegments() {
// Upload file to Aspose Cloud Storage
$fileName = "sample-input.pdf";
Utils::uploadFile($fileName);
$result = $this->pdfApi->GetSegments($fileName, $pageNumber = 1, $fragmentNumber = 1, $withEmpty = "", $storage = "", $folder = "");
print_r ( $result );
}
}
$text = new Text();
$text->getSegments();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Text {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function getSegmentTextFormat() {
// Upload file to Aspose Cloud Storage
$fileName = "sample-input.pdf";
Utils::uploadFile($fileName);
$result = $this->pdfApi->GetSegmentTextFormat($fileName, $pageNumber = 1, $fragmentNumber = 1, $segmentNumber = 1, $storage = "", $folder = "");
print_r ( $result );
}
}
$text = new Text();
$text->getSegmentTextFormat();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Text {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function getTextItems() {
// Upload file to Aspose Cloud Storage
$fileName = "Sample-Annotation.pdf";
Utils::uploadFile($fileName);
$result = $this->pdfApi->GetTextItems($fileName, $withEmpty = "", $storage = "", $folder = "");
print_r ( $result );
}
}
$text = new Text();
$text->getTextItems();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Text {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function postDocumentReplaceText() {
// Upload file to Aspose Cloud Storage
$fileName = "sample-input.pdf";
Utils::uploadFile($fileName);
$body = array("OldValue" => "Sample PDF", "NewValue" => "Sample Aspose PDF", "Regex" => "false");
$result = $this->pdfApi->PostDocumentReplaceText($fileName, $storage = "", $folder = "", $body);
print_r ( $result );
}
}
$text = new Text();
$text->postDocumentReplaceText();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Text {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function postDocumentReplaceTextList() {
// Upload file to Aspose Cloud Storage
$fileName = "Sample-Annotation.pdf";
Utils::uploadFile($fileName);
$body = array('TextReplaces' => array(array('OldValue' => "Sample", 'NewValue' => "Sample Aspose", 'Regex' => false),
array('OldValue' => "PDF", 'NewValue' => "PDF Document", 'Regex' => false)));
$result = $this->pdfApi->PostDocumentReplaceTextList($fileName, $storage = "", $folder = "", $body);
print_r ( $result );
}
}
$text = new Text();
$text->postDocumentReplaceTextList();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Text {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function postPageReplaceText() {
// Upload file to Aspose Cloud Storage
$fileName = "sample-input.pdf";
Utils::uploadFile($fileName);
$body = array("OldValue" => "Sample PDF", "NewValue" => "Sample Aspose PDF", "Regex" => false);
$result = $this->pdfApi->PostPageReplaceText($fileName, $pageNumber = 1, $storage = "", $folder = "", $body);
print_r ( $result );
}
}
$text = new Text();
$text->postPageReplaceText();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Text {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function postPageReplaceTextList() {
// Upload file to Aspose Cloud Storage
$fileName = "sample-input.pdf";
Utils::uploadFile($fileName);
$body = array('TextReplaces' => array(array('OldValue' => "Sample", 'NewValue' => "Sample Aspose", 'Regex' => false),
array('OldValue' => "PDF", 'NewValue' => "PDF Document", 'Regex' => false)));
$result = $this->pdfApi->PostPageReplaceTextList($fileName, $pageNumber = 1, $storage = "", $folder = "", $body);
print_r ( $result );
}
}
$text = new Text();
$text->postPageReplaceTextList();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once __DIR__ . '/vendor/autoload.php';
use Aspose\Storage\StorageApi;
use Aspose\Storage\AsposeApp;
class Utils {
# Get App key and App SID from https://cloud.aspose.com
const appSID = "App SID";
const apiKey = "App Key";
public static function uploadFile($fileName) {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$storage = new StorageApi();
$file = realpath(__DIR__ . '/../..') . '/Data/' . $fileName;
$result = $storage->PutCreate($Path=$fileName, $versionId = null, $storage = null, $file);
}
}
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Watermark {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function addImageStampToAPDFPage() {
// Upload file to Aspose Cloud Storage
$fileName = "sample-input.pdf";
Utils::uploadFile($fileName);
$imageFile = "aspose-cloud.png";
Utils::uploadFile($imageFile);
$body = array("FileName"=>$imageFile, "Type"=>"Image", "Background"=>true, "Value"=>"ASPOSE Document", "PageIndex"=> 0,
"LeftMargin"=>0.0, "Opacity"=>0.5, "RightMargin"=>0.0, "TopMargin"=>0.0, "YIndent"=>100.0,
"XIndent"=>100.0, "Zoom"=>1.0, "Width"=>300.0, "Height"=>300.0);
$result = $this->pdfApi->PutPageAddStamp($name=$fileName, $pageNumber = 1, $storage = "", $folder = "", $body);
print_r ( $result );
}
}
$watermark = new Watermark();
$watermark->addImageStampToAPDFPage();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Watermark {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function addPageNumberStampToPDFPage() {
// Upload file to Aspose Cloud Storage
$fileName = "sample-input.pdf";
Utils::uploadFile($fileName);
$body = array("Type"=>"PageNumber", "Background"=>true, "Value"=>"Page # of 2", "PageIndex"=> 0,
"LeftMargin"=>0.0, "Opacity"=>0.5, "RightMargin"=>0.0, "TopMargin"=>0.0, "YIndent"=>100.0,
"XIndent"=>100.0, "Zoom"=>1.0, "Width"=>300.0, "Height"=>300.0, "StartingNumber"=>1);
$result = $this->pdfApi->PutPageAddStamp($fileName, $pageNumber = 1, $storage = "", $folder = "", $body);
print_r ( $result );
}
}
$watermark = new Watermark();
$watermark->addPageNumberStampToPDFPage();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Watermark {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function addPageStamp() {
// Upload file to Aspose Cloud Storage
$fileName = "sample-input.pdf";
Utils::uploadFile($fileName);
$body = array("Type"=>"Text", "Background"=>true, "Value"=>"Aspose");
$result = $this->pdfApi->PutPageAddStamp($fileName, $pageNumber = 1, $storage = "", $folder = "", $body);
print_r ( $result );
}
}
$watermark = new Watermark();
$watermark->addPageStamp();
?>
# For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\PDF\PdfApi;
use Aspose\PDF\AsposeApp;
class Watermark {
public $pdfApi;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->pdfApi = new PdfApi();
}
public function addPDFPageAsStampToPDFPage() {
// Upload file to Aspose Cloud Storage
$fileName = "sample-input.pdf";
Utils::uploadFile($fileName);
$pdfName = "Sample.pdf";
Utils::uploadFile($pdfName);
$body = array("FileName"=>$pdfName, "Type"=>"Image", "Background"=>true, "PageIndex"=> 0,
"LeftMargin"=>0.0, "Opacity"=>0.5, "RightMargin"=>0.0, "TopMargin"=>0.0, "YIndent"=>100.0,
"XIndent"=>100.0, "Zoom"=>1.0, "Width"=>300.0, "Height"=>300.0);
$result = $this->pdfApi->PutPageAddStamp($fileName, $pageNumber = 1, $storage = "", $folder = "", $body);
print_r ( $result );
}
}
$watermark = new Watermark();
$watermark->addPDFPageAsStampToPDFPage();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.