TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sergey
NA
3
0
HELP -> open PDF file with "#search=word" option by using Response.WriteFile
Feb 25 2011 10:05 AM
Hello . I hope someone can help me :)
I need to open a pdf file like :
www.mysite.com/myfile.pdf#search=word
This opens the file and selects the first found word "word".
It is working perfect ... but I need to do the same but if the file is located in app_data folder ... or in a database ...
The problem is that '#' is replaced with '_'.
It might be that the approach is wrong in general ... any suggestions ?
Thanks !
here is the code :
System.IO.FileInfo file = new System.IO.FileInfo(MapPath("~/app_data/Files/" + "myfile.pdf"));
if (file.Exists)
{
Response.Buffer = true;
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
string fname = "MyFile.pdf#search=word";
string disp = String.Format("attachment; filename={0}", fname);
Response.AddHeader("Content-Disposition", disp);
Response.Charset = "UTF-8";
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/pdf";
Response.WriteFile(file.FullName);
Response.End();
}
Reply
Answers (
2
)
serialization buttons and controls elements into a textfile
Split??