How do I convert dynamic Silverlight content to PDF?

66 views
Skip to first unread message

Support

unread,
Oct 17, 2011, 7:44:58 PM10/17/11
to silv...@googlegroups.com
Q:  Is there a way to use your SDK to convert a silverlight client side dynamic user control into pdf without converting to a writeable bitmap and then to xps and then to pdf?
 
----------------------
A: The Silverlight control itself does not have a relevant function.

 

You can serialize the dynamic content to XAML string, send xaml to server, convert XAML to PDF using PDFNet - as shown in Xaml2Pdf (http://www.pdftron.com/pdfnet/samplecode.html#Xaml2Pdf)  and return the result as part of the http response.

Support

unread,
Oct 18, 2011, 2:50:05 PM10/18/11
to silv...@googlegroups.com
Q:
 
Thanks, I saw that example. The question is how do I serialize the dynamic control to xaml. Do you have a sample to convert a contentcontrol to a xaml string to send to server?
 
--------------------
A: 
 
There’s a project that tries to serialize XAML

http://www.davidpoll.com/2010/07/25/to-xaml-with-love-an-experiment-with-xaml-serialization-in-silverlight/

 

Demo is here http://www.davidpoll.com/Samples/SLaB/#pack://siteoforigin:,,UtilitiesContent.xap/UtilitiesContent;component/UiXamlSerializerDemo.xaml

 

Some more related projects

·         http://weblogs.asp.net/mehrantoosi/archive/2008/03/03/silverlight-s-xamlwriter.aspx

·         http://projectsilverlight.blogspot.com/2009/10/silverlight-3-xamlwriter-v04.html

·         http://silverlightcontrib.codeplex.com/sourcecontrol/changeset/view/49151?projectName=silverlightcontrib#602856

 

Reply all
Reply to author
Forward
0 new messages