4

I need to create silverlight application where customer will see some pdf files. PDF files have to be inside silverlight control and not rendered as images (customer wants to select text)

For this purposes i need some free libriaries or code to convert pdf file to xaml (or just open pdf so i can convert it to xaml).

Which library can read pdf and help me to convert data to xaml? Can I read somehow pdf file and write custom convertation tool?

I saw iTextSharp. Is this library can read pdf and help me with my issue?

I will be thankfull for any ideas or links.

Marina
  • 122
  • 2
  • 9

1 Answers1

3

I make use of the Acrobat Reader plugin to do the displaying for me. It does require a different method depending on whether your application is running inside or outside the browser (I check if the application is running inside the browser and change the means of display accordingly). If running inside the browser, I overlay the application with an IFrame, as I describe in this article: http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx. Otherwise, I use the WebBrowser control. I have a control which does this all for you in the source code that accompanies my book, which is downloadable from the Apress website here: http://www.apress.com/9781430272076/.

Hope this helps...

Chris

Chris Anderson
  • 8,279
  • 2
  • 20
  • 18
  • 1
    Thanks for help. As I understood the user should install the Adobe Reader? I'm interested in entire PDF-renders with open source of Silverlight applications. Is there approach to process pdf files and output them into some Silverlight controls? – Marina Jan 23 '11 at 13:29
  • 2
    Yes, it assumes the user has Adobe Reader installed. There's no Silverlight PDF renderers that I know of. I know Koen Zwikstra of First Floor Software (and Silverlight Spy fame) did some work in his (commercial) Document Toolkit (http://firstfloorsoftware.com/documenttoolkit), adding experimental support for displaying PDF documents, although I don't know where that's at at the moment. If PDF isn't a fixed requirement, you may want to consider XPS documents instead, which the Document Toolkit is based around and fully supports. However, for an easy (and free) solution, my method works well. – Chris Anderson Jan 23 '11 at 15:30
  • 2
    Can I convert pdf to xps on server? As I understand there is no free converter from pdf to xps? – Marina Jan 23 '11 at 18:10
  • 2
    I don't know of any free PDF converters unfortunately. But some more info is here: http://documenttoolkit.codeplex.com/wikipage?title=How%20To%20Convert%20Documents%20To%20Xps&referringTitle=Documentation – Chris Anderson Jan 24 '11 at 07:22
  • FYI, the URL for the download doesn't seem to work anymore. You can see the download in a tab here: (http://www.apress.com/9781430272076) – Steve Wranovsky Sep 23 '11 at 14:05