ByteScout PDF Renderer SDK - VBScript and VB6 - PDF to 1-bit BMP - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

ByteScout PDF Renderer SDK – VBScript and VB6 – PDF to 1-bit BMP

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Renderer SDK – VBScript and VB6 – PDF to 1-bit BMP

ByteScout PDF Renderer SDK – VBScript and VB6 – PDF to 1-bit BMP

PDFToBmp.vbs

' Create Bytescout.PDFRenderer.RasterRenderer  object
Set renderer = CreateObject("Bytescout.PDFRenderer.RasterRenderer")

renderer.RegistrationName = "demo"
renderer.RegistrationKey = "demo"

' Load sample PDF document
renderer.LoadDocumentFromFile "../../multipage.pdf"

' Image format: 0 - BMP; 1 - JPEG; 2 - PNG; 3 - TIFF; 4 - GIF
Dim outputImageFormat
outputImageFormat = 2

' Render PDF document at 96 DPI - default PC display resolution
' To get higher quality output, set 200, 300 or more
Dim renderingResolution
renderingResolution = 96

Set renderingOptions = CreateObject("Bytescout.PDFRenderer.RenderingOptions")
' Set pixel format to 1-bit
renderingOptions.ImageBitsPerPixel = 0 ' 0 - 1-bit; 1 - 8-bit; 2 - 24-bit; 3 - 32-bit

' iterate through pages
For i = 0 To renderer.GetPageCount() - 1
	' Save 1-bit image to file
	renderer.Save_2 "page" & CStr(i) & ".bmp", outputImageFormat, i, renderingResolution, (renderingOptions)
Next



  Click here to get your Free Trial version of the SDK

Tutorials:

prev
next