Share via


Shorties 002: WebView Anchoring, Crash Logs, PDF Viewer

WEBVIEW AND ANCHOR LOCATION

Sometimes you want to display HTML in the WebView control but jump to a particular anchor. Say:

    1: webView1.Navigate(new Uri("https://localhost:8088/" + filename + "/" + rootfolder + "/" + htmlfile.Name));
    2:                             List<Uri> MyUris = new List<Uri>();
    3:                             MyUris.Add(new Uri("https://localhost:8088/" + filename + "/" + rootfolder + "/" + htmlfile.Name));
    4:  
    5:                             webView1.AllowedScriptNotifyUris = MyUris;

To have the control jump to the specific anchor location simple append the anchor in the URL. For the code above, keep in mind that localhost is not allow to be used in released apps.


OPENING CRASH LOG REPORTS

Whenever you have to need to inspect a crash log, typically including three files: EventLog.xml, Report.cab, and Report.wer, the preferred tool to use memory dump files is to use windbg.exe. This is not part of the Visual Studio package so you have to install the full Windows SDK. The dump should open automatically to the crashing calls stack and give you the source of the exception. You can open the .bmp file from VS File | Open |File… but this method wont show the detail about what lien of code produced the error.


PDF VIEW COMPONENTS

At times you want to display  the content of a PDF in your Windows Store app. some go as far as displaying an image version of the file which is not very useful if you want to select text, etc. In looking into this I came across Paul E Whitaker’s blog post where you summarizes most of what’s available out there: LEADTOOLS WinRT SDK, PDFTron Mobile PDF SDK, and others like ComponentOne PfdfViewer.

 


THE TOOLS DEPARTMENT
free/trial tools for developers

image

  • Think blue sky with Azure free trial

image

image

image