Sample source code below will show you how to cope with a difficult task like extract image coordinates by page from PDF in VBScript. What is ByteScout PDF Extractor SDK? It is the Software Development Kit (SDK) that is designed to help developers with data extraction from unstructured documents like pdf, tiff, scans, images, scanned and electronic forms. The library is powered by OCR, computer vision and AI to provide unique functionality like table detection, automatic table structure extraction, data restoration, data restructuring and reconstruction. Supports PDF, TIFF, PNG, JPG images as input and can output CSV, XML, JSON formatted data. Includes full set of utilities like pdf splitter, pdf merger, searchable pdf maker. It can help you to extract image coordinates by page from PDF in your VBScript application.
You will save a lot of time on writing and testing code as you may just take the VBScript code from ByteScout PDF Extractor SDK for extract image coordinates by page from PDF below and use it in your application. In order to implement the functionality, you should copy and paste this code for VBScript below into your code editor with your app, compile and run your application. Enjoy writing a code with ready-to-use sample VBScript codes.
ByteScout PDF Extractor SDK free trial version is available on our website. VBScript and other programming languages are supported.
' Create Bytescout.PDFExtractor.ImageExtractor object Set extractor = CreateObject("Bytescout.PDFExtractor.ImageExtractor") extractor.RegistrationName = "demo" extractor.RegistrationKey = "demo" ' Load sample PDF document extractor.LoadDocumentFromFile("..\..\sample1.pdf") ' Get page count pageCount = extractor.GetPageCount() ' Extract images from each page For i = 0 To pageCount - 1 j = 0 ' Initialize page images enumeration If extractor.GetFirstPageImage(i) Then Do outputFileName = "page" & i & "image" & j & ".png" ' display coordinates of the image MsgBox "Image #" & CStr(j) & " on page #" & CStr(i) & vbCRLF & "Coordinates: " & _ CStr( extractor.GetCurrentImageRectangle_Left()) & ", " & CStr( extractor.GetCurrentImageRectangle_Top()) & ", " & _ CStr( extractor.GetCurrentImageRectangle_Width()) & ", " & CStr( extractor.GetCurrentImageRectangle_Height()) j = j + 1 Loop While extractor.GetNextImage() ' Advance image enumeration End If Next Set extractor = Nothing