Frage

I am developing an App for Windows Phone 7, in which I need to display a PDF file.
So basically I need any free library if available to view PDF files or any other way to achieve this.

Please guide me, any solution for this.

Thanks

War es hilfreich?

Lösung

There are 3 ways to open PDF file on Windows Phone:

  1. Use "native" PDF viewer - Adobe Reader

    To do that, you need a location URI of your PDF file, and then you can either use the HyperlinkButton

    <HyperlinkButton Content="Click here to open PDF"
    NavigateUri="URI of your PDF" TargetName="_blank" Margin="10,60,0,0"/>
    

    or you could use the WebBrowser task to browse to the PDF which will invoke the PDF viewer:

    WebBrowserTask browser = new WebBrowserTask();
    browser.URL = "URI of your PDF";
    browser.Show();
    
  2. Use ComponentOne control for viewing PDFs

    http://www.componentone.com/SuperProducts/PdfViewerPhone/

    This will cost you some money, but should work OK.

  3. Write your own control for rendering PDFs :)))

Andere Tipps

The control from Component One is the most highly rated one I've seen but it is not free.

You could also taker a look at http://www.rasteredge.com/how-to/csharp-imaging/pdf-reading/ or http://code.google.com/p/mupdf/

Generally displaying PDF files is non-trivial and that is why there are no supported free controls available.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top