views:

1409

answers:

4

Hi, I want to make a PDF document reader, and the only thing I've found to help me is "Amyuni PDF Suite" that will turn the PDF into XAML and stream that. Are there any other controls for displaying PDFs in Silverlight? Or could I add an IFrame into Silverlight and let the client render it?

Cheers

Nik

+1  A: 

Or could I add an IFrame into Silverlight and let the client render it?

Silverlight doesn't really have that capability. You can make your Silverlight control transparent, and have an HTML div block that sits above your Silverlight control, which you could then load a PDF in, but as for displaying a PDF within Silverlight, I think you're out of luck.

Edit: This question has some info on how to accomplish transparent Silverlight controls, I hope it helps!

unforgiven3
Thanks for the idea, do you have a sample of how I could overlay my Silverlight control with a DIV?
niklassaers
I added a link in my answer, good luck!
unforgiven3
Thank you very much :-)
niklassaers
+1  A: 

If you're ok with buying the pdf converter you can do something like this:

CanvasObject.Children.Add(XamlReader.Load("xaml string from pdf converter"));

And the pdf should be rendered inside your CanvasObject.

I really think you'll get the best result with some type of conversion to XAML. I imagine it can't be that hard to write the converter yourself, I might be wrong though.

Oscar Kilhed
PDF is a very very very complex standard. Writing your own converter is almost certainly not an option.
PeterAllenWebb
Thanks, I'm ok with that, so sounds like a good option :-)
niklassaers
A: 

hi, have you find any solution to it? i am also looking for pdf reader in silverlight.

i am looking at "book page turn" option.

Pragnesh Patel
Nope, I haven't really, the project was put on ice but is now on its way back because of new interesting features of Silverlight 4
niklassaers
A: 

Looks like First Floor Software has a solution but it's still in preview.

http://firstfloorsoftware.com/blog/pdf-for-silverlight-preview/

What we are actually trying to do is convert the PDF to SVG, then use something like: http://www.codeplex.com/XamlTune to then go to Xaml

Rob