任何人都可以说,如何在网页上显示带有搜索文字功能的pdf文件。
答案 0 :(得分:2)
如果您的意思是在pdf文件中搜索,您可以这样做:
最后这是您进行搜索的代码:
DataSet ds = new DataSet("IndexServerResults");
CissoQueryClass q = new CissoQueryClass();
CissoUtilClass util = new CissoUtilClass();
OleDbDataAdapter da = new OleDbDataAdapter();
string query = "";
if (lstSearchIntegration.SelectedValue == "-1") {
query = "@all Contains " + txtKeywordOne.Text + " and not #filename *.log";
} else {
string operation = "";
if (lstSearchIntegration.SelectedValue.ToLower == "and") {
operation = "and";
} else {
operation = "or";
}
query = "@all Contains " + txtKeywordOne.Text + " " + operation + " " + txtKeywordTwo.Text;
}
switch (lstDocType.SelectedValue) {
case "doc":
query += " and #filename *.doc";
break;
case "pdf":
query += " and #filename *.pdf";
break;
case "ppt":
query += " and #filename *.ppt";
break;
case "pps":
query += " and #filename *.pps";
break;
}
q.Query = query;
q.Catalog = "YourCatalogName";
q.SortBy = "rank[d]";
q.Columns = "DocAppName,rank, path, size, FileName,VPath, Create";
q.MaxRecords = 1000;
util.AddScopeToQuery(q, "YourFolder", "deep");
object obj = q.CreateRecordset("nonsequential");
da.Fill(ds, obj, "IndexServerResults");
DataTable mydt = new DataTable();
mydt = ds.Tables[0];
请注意:
答案 1 :(得分:0)
我可以建议Aspose.PDF,但要花钱