Aspose.PDF Cloud
Aspose.PDF Cloud’s platform independent document manipulation API is a true REST API that can be used with any language: .NET, Java, PHP, Ruby, Rails, Python, jQuery and many more. You can use it with any platform — web, desktop, mobile, and cloud.
Aspose.PDF Cloud is a PDF document creation API that enables you to read, write, convert and manipulate PDF documents on the cloud. Learn More
New PDF Features in the Aspose Cloud PHP SDK
We have implemented the following features:
- Create PDF from JPEG - This feature allows you to create PDF file from JPEG using Aspose.PDF Cloud API in your applications.
- Create PDF from SVG - This feature allows you to create PDF file from SVG using Aspose.PDF Cloud API in your applications.
- Create PDF from TIFF - This feature allows you to create PDF file from TIFF using Aspose.PDF Cloud API in your applications.
- Sign PDF Documents - This feature allows you to sign PDF documents using Aspose.PDF Cloud API in your applications.
- Add Text Stamp (Watermark) to a PDF Page - This feature allows you to insert watermark text as stamp to a PDF page using Aspose.PDF Cloud API in your applications.
- Add Image Stamp (Watermark) to a PDF Page - This feature allows you to insert watermark image as stamp to a PDF page using Aspose.PDF Cloud API in your applications.
- Add PDF Page as Stamp (Watermark) to a PDF Page - This feature allows you to insert page of one PDF as watermark or stamp to another PDF page using Aspose.PDF Cloud API in your applications.
- Add Page Number Stamp to a PDF Page - This feature allows you to insert page number stamp to a PDF page using Aspose.PDF Cloud API in your applications.
- Update a Form Field in a PDF Document - This example allows you to update form fields in a PDF document using Aspose.PDF Cloud API in your applications.
Download
You can download it using “Composer” from any of the following places:
- https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP
- https://packagist.org/packages/aspose/cloud-sdk-php
You can download latest release in zip format from https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/releases/tag/v1.0.2
Usage Example
Add Text Stamp (Watermark) to a PDF Page
use Aspose\Cloud\Common\AsposeApp;
use Aspose\Cloud\Common\Product;
use Aspose\Cloud\PDF\Document;
Product::$baseProductUri = 'https://api.aspose.cloud/v3.0/';
AsposeApp::$appSID = "XXXXXXXXXX";
AsposeApp::$appKey = "XXXXXXXXXX";
AsposeApp::$outPutLocation = getcwd() . "/output/";
$fieldsArray = array( "Type"=> 0,
"Background"=> true,
"BottomMargin"=> 2.0,
"HorizontalAlignment"=> 1,
"LeftMargin"=> 3.0,
"Opacity"=> 0.5,
"RightMargin"=> 0.0,
"Rotate"=> 3,
"RotateAngle"=> 45.0,
"TopMargin"=> 4.0,
"VerticalAlignment"=> 3,
"XIndent"=> 2.0,
"YIndent"=> 2.5,
"Zoom"=> 1.5,
"TextAlignment"=> 0,
"Value"=> "Watermark text stamp",
"TextState"=> array(
"FontSize"=> 14.0,
"Font"=> "Arial",
"ForegroundColor"=> array(
"A"=> 0,
"R"=> 255,
"G"=> 0,
"B"=> 0
),
"BackgroundColor"=> array(
"A"=> 0,
"R"=> 0,
"G"=> 0,
"B"=> 255
),
"FontStyle"=> 2
),
"FileName"=> null,
"Width"=> 0.0,
"Height"=> 0.0,
"PageIndex"=> 0,
"StartingNumber"=> 0);
$postData = json_encode($fieldsArray);
$document = new Document('stamp.pdf');
$result = $document->addStamp($pageNumber=1, $postData);
Start a Free Trial Today
Start a free trial today – all you need is to sign up with the Aspose Cloud service. Once you have signed up, you are ready to try the powerful file processing features offered by Aspose Cloud.