是否有可能使用iTextSharp获取pdf文档指定区域中包含的所有文本?

谢谢.
我有一个签名的 PDF 文件。使用这个使用 iTextSharp 库的函数,我找到了证书 p7m 签名:
private void GetSignature(string FileName)
{
AcroFields acroFields = new PdfReader(FileName).AcroFields;
List<string> names = acroFields.GetSignatureNames();
foreach (var name in names)
{
PdfDictionary dict = acroFields.GetSignatureDictionary(name);
PdfString contents = (PdfString)PdfReader.GetPdfObject(dict.Get(PdfName.CONTENTS));
byte[] PKCS7 = contents.GetOriginalBytes();
ByteArrayToFile(@"c:\signature\" + name + ".p7m", PKCS7);
}
}
Run Code Online (Sandbox Code Playgroud)
现在...如何提取与签名关联的图像(位图)?是否可以?谢谢,路易吉
我正在尝试获取此页面的源代码(http://www.sanmarinocard.sm),但dataWithContentsOfURL不会检索数据.
NSURL *url = [NSURL URLWithString:@"http://www.sanmarinocard.sm"];
NSData *responseData = [NSData dataWithContentsOfURL:url];
NSString *result = [[NSString alloc] initWithData:responseData encoding:NSASCIIStringEncoding];
Run Code Online (Sandbox Code Playgroud)
直到前几天一切正常,但从昨天开始没有结果.
你能帮助我吗?谢谢.
当我执行我的查询时:
rs.Select(x => x.id).ToArray();
Run Code Online (Sandbox Code Playgroud)
我得到了这个错误:
LINQ to Entities不支持LINQ表达式节点类型"Invoke"
这是生成错误的方法(可能是func(x)):
public IQueryable<TEntity> Compare<TEntity>(IQueryable<TEntity> source, Func<TEntity, int> func)
{
IQueryable<TEntity> res = source;
if (!this.LBoundIsNull) res = res.Where(x => func(x) >= _lBound);
if (!this.UBoundIsNull) res = res.Where(x => func(x) <= _uBound);
return res;
}
Run Code Online (Sandbox Code Playgroud)
我在这种模式下调用方法:
Document doc = new Document();
doc.Number = new RangeValues(lBound, null);
using (MyEntities db = new MyEntities())
{
var rs = db.documents;
if (doc.Number != null) rs = doc.Numero.Compare(rs, x => x.number);
long[] id = rs.Select(x …Run Code Online (Sandbox Code Playgroud) 我使用Visual Studio 2010在CSharp中创建了一个类库COM,可见.当我尝试调用此方法时:
public string Version {
get { return Assembly.GetEntryAssembly().GetName().Version.ToString(); }
}
Run Code Online (Sandbox Code Playgroud)
从VB6客户端我获得的Object引用未设置为对象的实例.其他方法正常.从.NET客户端一切正常!
怎么了?谢谢,路易吉.