Rasterizer 2017

ImageFormat

<?php
// Copyright (c) 2019 ActivePDF, Inc.
// ActivePDF Rasterizer 2017
// Example generated 09/16/19 
?>

<?php
// Get current path
$strPath = dirname(__FILE__) . "\\";

// Instantiate Object
$oRAS = new COM("APRasterizer.Object");

// Open PDF
$oRAS->OpenFile($strPath . "doc.pdf");

// Get page count of open file
$pageCount = $oRAS->NumPages();

$currentPage = 1;
for ($currentPage; $currentPage <= $pageCount; $currentPage++)
{
  // Image Format
  // 1 = RGB
  // 2 = JPEG
  // 3 = TIFF
  // 4 = PNG
  // 5 = BMP
  $oRAS->ImageFormat = 2;
  
  // Output Type
  // 1 = Stream
  // 2 = File
  $oRAS->OutputFormat = 2;
  
  // Other settings
  $oRAS->OutputFileName = $strPath . "doc" . $currentPage . ".jpg";
  $oRAS->JPEGQuality = 72;
  $oRAS->IncludeAnnotations = true;
  
  // Render the current page
  $oRAS->RenderPage($currentPage);
}

// Finished rendering pages, close file
$oRAS->CloseFile();

// Release Object
$oRAS = null;

// Process Complete
echo "Done!";
?>

Copyright © 2019 ActivePDF, Inc