How to use a specific PDF IFilter
Asked Answered
W

2

6

I'm trying to extract text from PDF files using an iFilter.

The Adobe PDF iFilter that is distributed with Adobe Reader is awful, returning HRESULT E_FAIL messages for many PDF documents.

The FoxIt PDF IFilter works beautifully on virtually all of the PDFs I've been using for testing.

The problem is that every time the Adobe Updater runs, it replaces the awesome FoxIt IFilter with the crappy Adobe IFilter.

I've been using the LoadIFilter method to get the registered IFilter for PDF files. Is there a way to force the Win32 API to load the FoxIt IFilter instead of the Adobe IFilter?

NOTE: This question about determining which IFilters are installed asks a related -- but not identical -- question.

Weatherworn answered 8/3, 2010 at 19:10 Comment(0)
V
3

The IFilter seems to be registered as a COM Object with windows, so you should be able to just create an instance of it using COM.

From http://msdn.microsoft.com/en-us/library/ms692565 : The structure of the DLL is that it has a IFilter and a IClassFactory

You should be able to instantiate the IClassFactory (given the CLSID)

check out http://msdn.microsoft.com/en-us/library/ms684007 http://msdn.microsoft.com/en-us/library/ms680760

Ventricose answered 27/4, 2010 at 1:48 Comment(0)
C
0

Beside the way above, you could simply check the systemwide used IFilter DLL for the file type you are interested in.

If you find the Adobe DLL instead of the Foxit DLL, change the InprocServer32 entry for the key the PersistentHandler of your filetype is refering to. This might need special rights, depending on the system you use. Then start the IFilter usage.

Have a look at the simply explanation of how the IFIlter DLLs are selected:

http://msdn.microsoft.com/en-us/library/ms692488

Competence answered 5/4, 2012 at 13:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.