I want to be able to show PDF docs within my Silverlight 4 application. I know there is no native support for this and the only real way to do this is to use a third party control. I’ve looked around and found what looks to be a couple of good options, but they are expensive and somewhat limited. I don’t know much about PDF docs, but it seems that most of these controls are converting PDFs to something else; such as XOD or XPS.
I am considering writing my own PDF Viewer for my needs, but not sure where to start on something like this. What would be the best format to convert PDFs to for Silverlight and WPF? If I could convert to RTF, I could use existing controls to display the document.
I’m assuming since there is such a lack of PDF for Silverlight controls out there that this will not be easy. Any help or guidance is greatly appreciated.
Thanks,
-Scott
You do have one more option besides re-implementing a pdf control.
With a bit of javascript and silverlight's DOM bridge, you can render your PDF in the browser's native pdf plugin and display it in a 'window' over the top of your silverlight application.
This is how many of the 3rd party "web browser" controls for silverlight work as well.
Related
I am looking for a feature rich charting library, I've seen infragistics but it is not performant enough when there are many data points rendered, on the other hand I see DynamicDataDisplay is a pretty awesome library, but the project is not maintained anymore. Could you list other charting libraries that I should be aware of. I am looking from performance and customizability criteria.
You can try to download a trial version of LightningChart, the fastest and fully configurable Charting and Data visualization components for .Net. Examples are included in download package.
You also can read about benchmark and see for yourself.
I have plotted line charts with around a million data points using ChartDirector, and it can plot it well within 1 second. However, ChartDirector is a Windows Forms control, so it needs to be hosted in a WindowsFormsHost control when used in WPF. You can also just display the chart as an image in a WPF image control, but then you lose the user interaction features (track cursors, drag to zoom/scroll, ...).
This is a hard question to search for as "help" and "documentation" generates a lot of false hits. I basically want to show some simple documentation or help in my Silverlight app. And I don't want to write this in XAML, obviously, so I would love to be able to add a WordPad (or similar, free and easy) document to my app that would get display with some basic formatting in Silverlight.
Any ideas?
Try embedding an iframe using an iframe overlay, then you can load any HTML-like content.
There is an excellent explanation of how to do this here:
http://www.wintellect.com/cs/blogs/jlikness/archive/2010/09/19/hosting-html-in-silverlight-not-out-of-browser.aspx
I have a problem. I want to make a web application using silver light. I just want to know that can I use a css in this, because I read the the designing of silver light is in the xaml or we use css with html tag.
Is anybody clear my confusion?
Thanks
Silverlight XAML ≠ HTML+CSS
These are all different technologies. You probably better know Adobe Flash. Well Silverlight is very similar. It (may) run in the context of a browser, but it has nothing to do with HTML and/or CSS. It uses XAML files (as you pronounce them zammel). So if you decide to write a Silverlight application you will have to use XAML files and use Expression Blend to design your UI. Doing so would be faster than hand editing XAML files.
xaml is like html + css but its not the same , they have some things in common but nothing much important .
Better find yourself good video tutorials or a book and learn it from there :)
No you can't really use CSS in a silverlight project.
If it's worth the effort, what you could do is manually load the required CSS files with the WebClient class and parse them to style your controls accordingly.
Someone did something similar with the Sharepoint theme files, which are yet another format. Using SharePoint thmx files to style Silverlight describes how to do it. Maybe you can find some inspiration from that.
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
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!
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.
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
you can use server side conversion of PDF say into set of bitmaps or as mentioned above SVG and return by WCF service to Silverlight client.
I would like to ask if there are any other alternatives, aside from DocumentViewer, for displaying an XPS document in a WPF application? A ready-to-use control or class in .NET if possible.
This is because DocumentViewer is a little slow when you are scrolling through the pages.
Thanks!
No, unless there are any third-party controls that I'm unaware of.
Use NiXPS to convert your XPS document to PDF and use any PDF viewer for WPF out there. This way you will get better performance than you do with DocumentViewer.