Sicos1977 / IFilterTextReader

A reader that gets text from different file formats through the IFilter interface
Other
55 stars 38 forks source link

Errors processing with Adobe PDF Filter 11 #17

Closed mdesousa closed 7 years ago

mdesousa commented 7 years ago

Hi, this is a great library... works well for other document formats, but I am having problems with PDF. When I try to process using the Adobe PDF Filter 11 I get the error below. I found this blog, which suggests that the Adobe Filter has a hardcoded whitelist of processes that it supports. I tested this by renaming my executable to filtdump.exe, and everything works well. Does this happen to anyone else?

System.Exception: DLL name: 'C:\Program Files\Adobe\Adobe PDF iFilter 11 for 64-bit platforms\bin\PDFFilter.dll' Class: {E8978DA6-047F-4E3D-9C78-CDBE46041603}' ---> System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component. at IFilterTextReader.NativeMethods.IClassFactory.CreateInstance(Object pUnkOuter, Guid& refiid, Object& ppunk) at IFilterTextReader.FilterLoader.LoadFilterFromDll(String dllName, String filterPersistClass) in C:\Users\Kees\Documents\GitHub\IFilterTextReader\IFilterTextReader\FilterLoader.cs:line 207 --- End of inner exception stack trace --- at IFilterTextReader.FilterLoader.LoadFilterFromDll(String dllName, String filterPersistClass) in C:\Users\Kees\Documents\GitHub\IFilterTextReader\IFilterTextReader\FilterLoader.cs:line 211 at IFilterTextReader.FilterLoader.LoadAndInitIFilter(Stream stream, String extension, Boolean disableEmbeddedContent, String fileName, Boolean readIntoMemory) in C:\Users\Kees\Documents\GitHub\IFilterTextReader\IFilterTextReader\FilterLoader.cs:line 121 at IFilterTextReader.FilterReader..ctor(Stream stream, String extension, Boolean disableEmbeddedContent, Boolean includeProperties, Boolean readIntoMemory, FilterReaderTimeout filterReaderTimeout, Int32 timeout) in C:\Users\Kees\Documents\GitHub\IFilterTextReader\IFilterTextReader\FilterReader.cs:line 232

Sicos1977 commented 7 years ago

Did you use the Job class to sandbox your app? You need it to make ADOBE iFILTER work.

https://github.com/Sicos1977/IFilterTextReader/blob/master/IFilterTextReader/Job.cs

See this code about how to use the job class.

https://github.com/Sicos1977/IFilterTextReader/blob/master/IFilterTextViewer/MainForm.cs

mdesousa commented 7 years ago

Thank you! This solved the problem.