Link Search Menu Expand Document

Extract Text from PDF - ASP Classic

PDF Extractor SDK sample in ASP Classic demonstrating ‘Extract Text from PDF’

ExtractText.asp
<%

' In case of "Server.CreateObject Failed", "Server object error "ASP 0177 : 8000ffff" or similar errors:
' Please try the following:
' - Open IIS 
' - Find application pools (DefaultAppPool is used by default)
' - Open its properties and check .NET CLR version selected:
' - if you have  .NET 1.1 then change to .NET CLR 2.00
' - if you have .NET CLR 2.00 then try to change to .NET CLR 4.0


Set extractor = CreateObject("Bytescout.PDFExtractor.TextExtractor")
extractor.RegistrationName = "demo"
extractor.RegistrationKey = "demo"

' Load sample PDF document
extractor.LoadDocumentFromFile("..\..\sample2.pdf")

' Save extracted text to file
outputText = extractor.GetText()

response.ContentType = "application/text"

' add content type header 
response.AddHeader "Content-Type", "application/text"

' set the content disposition
response.AddHeader "Content-Disposition", "inline;filename=HelloWorld.text"

' write the output text
response.Write OutputText
response.End


Set extractor = Nothing

%>

Download Source Code (.zip)

Return to the previous page Explore PDF Extractor SDK