using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EPocalipse.IFilter;
namespace Everest.Library.IO{
/// <summary>
/// Download IFilter from:
/// .docx, .docm, .pptx, .pptm, .xlsx, .xlsm, .xlsb, .zip, .one, .vdx, .vsd, .vss, .vst, .vdx, .vsx, and .vtx :http://www.microsoft.com/downloads/details.aspx?FamilyId=60C92A37-719C-4077-B5C6-CAC34F4227CC&displaylang=en
/// pdf:http://www.adobe.com/support/downloads/thankyou.jsp?ftpID=2611&fileID=2457
/// </summary>
public class IFilterDocumentReader : IDocumentReader
{
#region IDocumentReader Members
public IList<string> SupportedExtensions
{
get { return new List<string>() { "*.*" }; }
}
public bool ReadAsText(string filePath, out string content)
{
FilterReader filterReader = FilterReader.CreateFilterReader(filePath);
content = string.Empty;
try
{
if (filterReader != null)
{
content = filterReader.ReadToEnd();
return true;
}
}
catch (Exception e)
{
Everest.Library.HealthMonitor.HealthMonitoringLogging.LogError(e);
}
return false;
}
#endregion
}
}
|