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:

  1. works if protocol http
  2. works if resource .htm / .html - when protocol file://
  3. works if file .pdf , protocol http (same 1.)
  4. fails if refers local pdf file, fragment gets lost

any workaround this?


revisions:

  1. 20110219 - update c.haas. chris shows, ok ".htm", fails ".pdf" , if refers local resource.
  2. 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

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -