# Copyright (c) 2021 ActivePDF, Inc. # ActivePDF Rasterizer 2017 # Example generated 03/03/21 # Get current path $invocation = (Get-Variable MyInvocation).Value $strPath = (Split-Path $invocation.MyCommand.Path) + "\" # Instantiate Object $oRAS = New-Object -ComObject APRasterizer.Object # Open PDF $oRAS.OpenFile($strPath + "doc.pdf") # Output Type # 1 = Stream # 2 = File $oRAS.OutputFormat = 2 # Set the file path for the created TIFF $oRAS.OutputFileName = $strPath + "doc.tiff" # Set whether to include PDF annotations in the conversion $oRAS.IncludeAnnotations = $True # Set the pages to convert $oRAS.AddPageRange(1, 2) $oRAS.AddPageRange(4, 4) # Create the TIFF $oRAS.CreateMultipageTIFF() # Finished with PDF, close file $oRAS.CloseFile() # Release Object $oRAS = $null # Process Complete Write-Host "Done!"