Blog : PDF convert and manipulation API - php
PDF convert and manipulation API - php
Click here for Instructions to use C# Library
Step by step instructions
Step 1: Click here to obtain an api license key (opens in new window)
By using our registration form, you will get an API key which will be needed to make calls to PDFaid.com.
Step 2: Click here to download the API Class
The package contains a php file and a readme document.
Step 3: Deploy the php file
Copy
the downloaded pdfaidservices php file at the root of your website or
any other location of your choice. Include the reference to the
pdfaidservices php file in your own php file where you want to use the
pdfaid functionality. Please note that you must reference with the right
path.
Example: include "PdfaidServices.php" //assuming that both the files are in the same folder
Sample Codes for various applications
Compress PDF
include 'PdfaidServices.php';
$compressPdf = new PdfCompresser();
$compressPdf->apiKey = "your-api-key";
$compressPdf->inputPdfLocation = "compress.pdf";
//please make sure that the dir is writable chmod 777
$compressPdf->outputPdfLocation = "UploadedPdf/compresspdf.pdf";
$compressPdf->compressImages = TRUE;
$compressPdf->colorImageQuality = 50;
$compressPdf->greyImageQuality = 50;
$compressPdf->monoChromeImageQuality = 50;
$compressPdf->compressStreams = TRUE;
$compressPdf->unembedComplexFonts = TRUE;
$compressPdf->unembedSimpleFonts = TRUE;
$compressPdf->unembedUnusualFonts = TRUE;
$compressPdf->flattenPdf = TRUE;
//$result will be OK or APINOK or Error Message
$result = $compressPdf->CompressPdf();