Rasterizer 2017

RenderPage

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

<!-- Example uses the .NET DLL which requires -->
<!-- Coldfusion 8 or above -->

<CFSCRIPT>
// Get current path
strPath = ExpandPath(".") & "\";


// Instantiate Object
oRAS = CreateObject(".NET", "APRasterizerNET.Rasterizer", "C:\Program Files\ActivePDF\Rasterizer\DotNetComponent\4.5\APRasterizerNET.dll");

// Open PDF
oRAS.OpenFile(strPath & "doc.pdf");

// Get page count of open file
pageCount = oRAS.NumPages();

currentPage = 1;
for (currentPage; currentPage <= pageCount; currentPage=currentPage + 1)
{
  // Image Format
  enumImageType = CreateObject(".NET", "APRasterizerNET.ImageType", "C:\Program Files\ActivePDF\Rasterizer\DotNetComponent\4.5\APRasterizerNET.dll");
  oRAS.Set_ImageFormat(enumImageType.ImgJPEG);
  
  // Output Type
  enumOutputFormatType = CreateObject(".NET", "APRasterizerNET.OutputFormatType", "C:\Program Files\ActivePDF\Rasterizer\DotNetComponent\4.5\APRasterizerNET.dll");
  oRAS.Set_OutputFormat(enumOutputFormatType.OutFile);
  
  // Other settings
  oRAS.Set_OutputFileName(strPath & "doc" & currentPage & ".jpg");
  oRAS.Set_JPEGQuality(72);
  oRAS.Set_IncludeAnnotations(true);
  
  // Render the current page
  oRAS.RenderPage(currentPage);
}

// Finished rendering pages, close file
oRAS.CloseFile();

// Release Object
oRAS = 0;

// Process Complete
WriteOutput("Done!");
</CFSCRIPT>

Copyright © 2019 ActivePDF, Inc