Can anyone tell, how to display pdf file on web with search text functionality.
If you mean searching inside the pdf files, you can do this:
finally here is your code for doing the search:
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];
Please note that:
I can suggest Aspose.PDF but it costs money