ExtractTextFromPageArea.vbs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ' Create TextExtractor object Set extractor = CreateObject( "Bytescout.PDFExtractor.TextExtractor" ) extractor.RegistrationName = "demo" extractor.RegistrationKey = "demo" ' Load sample PDF document extractor.LoadDocumentFromFile( "..\..\sample1.pdf" ) ' Get page count pageCount = extractor.GetPageCount() ' Iterate through pages For i = 0 to pageCount - 1 ' Set extraction area (in Points. 1 Point = 1/72 in.) extractor.SetExtractionArea 0, 0, 200, 200 ' Extract text from the extraction area text = extractor.GetTextFromPage(i) Wscript.echo "Page #" & CStr (i) & " text from area (0, 0, 200, 200): " & vbCr & vbLf & text extractor.ResetExtractionArea Next Set extractor = Nothing |
Click here to get your Free Trial version of the SDK
also available as: