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:

Download

You can download it using “Composer” from any of the following places:

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 = 'http://api.aspose.com/v1.1';
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.