Extract text content from searchable PDF via VBA

Discussion for the End User use of OCR in PDF-XChange Editor and Viewer

Moderators: Daniel - PDF-XChange, PDF-XChange Support, Vasyl - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

Sergeij_Molotow
User
Posts: 2
Joined: Fri May 23, 2025 7:29 am

Extract text content from searchable PDF via VBA

Post by Sergeij_Molotow »

Dear community,

I'm using a licensed version of PDF-XChange Editor Plus.

I would like to extract text content from searchable PDFs via VBA. OCR is already applied.

Additional I have two related questions:
Where can I find an API for VBA oder a documentation, which provides more information how to interact between Excel VBA and XChange-PDF?
What's the name of the library to use in a late-binding statement?

Any help is appreciated! :)

Until now I've found the following code to start with, but I couldn't figure out, where other users got the object methods from.

Code: Select all

Public Function fncReadTextFromPDF(strFilepath as String) as String

    Dim PXV As PDFXEdit.PXV_Inst
    Dim pxc As New PDFXEdit.PXC_Inst
    Dim Doc As IPXC_Document
    
     Set PXV = New PDFXEdit.PXV_Inst

	PXV.Init
    
   Set pxc = PXV.GetExtension("PXC")
 
	pxc.Init ""
 
	Set Doc = pxc.OpenDocumentFromFile("File " & strFilepath, Nothing)
	
	Doc.Close

	pxc.Finalize

End Function
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 10998
Joined: Wed Jan 03, 2018 6:52 pm

Re: Extract text content from searchable PDF via VBA

Post by Daniel - PDF-XChange »

Hello, Sergeij_Molotow

I believe such actions would require an SDK license for use, and are not compatible with the End user products. If you need to make use of these functions, you will need to email Sales@PDF-XChange.com to explain the purpose of this function in your environment, and request permissions to purchase such a license.

Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Sergeij_Molotow
User
Posts: 2
Joined: Fri May 23, 2025 7:29 am

Re: Extract text content from searchable PDF via VBA

Post by Sergeij_Molotow »

Hi Dan,

thank you very much. I scan a lot of contracts for my company and have to add the information in a Excel-worksheet manually. I thought it would be a good idea to read out the scanned pdfs an to fill in the forms automatically. I keep your advice in mind.

Best regards,
Sergeij
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19851
Joined: Mon Jan 12, 2009 8:07 am

Re: Extract text content from searchable PDF via VBA

Post by Stefan - PDF-XChange »

Hello Sergeij_Molotow,

Thanks for the additional details, however as Dan said - those methods would require an SDK license, and can not be used with only the end user Editor.

Kind regards,
Stefan