Fragment (anchor #) in .NET 4 WebBrowser Control getting lost with Adobe PDF Reader and file:// -
i create uri fragment (aka anchor #).
uribuilder ub = new uribuilder("file://path/doc.pdf"); ub.fragment = "chapterx";
the url shown correctly in debugger (ub -> file://path/doc.pdf#chapterx
). when assign webbrowser control, fragment part gets lost (reason fragment see pdf open parameter).
this._mywebbrowser.url = ub.uri; // alternative this._mywebbrowser.navigate("file://path/doc.pdf#chapterx");
when check this._mywebbrowser.url
displays file://path/doc.pdf
. this._mywebbrowser.url.fragment
empty - readonly , cannot assigned.
as c.haas has shown below, concept works in general, reasons fails when resource local(!) pdf file.
summary:
- works if protocol http
- works if resource .htm / .html - when protocol file://
- works if file .pdf , protocol http (same 1.)
- fails if refers local pdf file, fragment gets lost
any workaround this?
revisions:
- 20110219 - update c.haas. chris shows, ok ".htm", fails ".pdf" , if refers local resource.
- 20110218 - finding abatishchev: if use
navigate
not work neither,navigate
offers provide frame name. in case external ie pops (because there no frame in control's page) , url fragment correctly displayed. not want, shows me url correct , bug seems within control.
how about
wb.navigate("http://example.com#chapterx");
?
Comments
Post a Comment