I'm already using the Telerik controls for Silverlight for some time but just ran into a feature that doesn't seem to be working anymore.
In one of my previous releases of my app I used to Export to PDF functionality to create a PDF of an UIElement. that release of the app used an older version of the Teleriks controls.
With the current release (2011.2.915.0) it's not working anymore.
Some debugging showed that it's probably the InlineUIContainer that's not working properly.
The following example shows my problem. It only displays the Hello text, but not the Button. I tried to put different UIElements in the InlineUIContainer, but none of them would show up on the PDF.
Can you tell me if i'm doing something wrong or is there a bug in the current Telerik release?
Thank you!
PdfFormatProvider provider = new PdfFormatProvider();Span sp = new Span() { Text = "Hello" };Paragraph para = new Paragraph() { TextAlignment = Telerik.Windows.Documents.Layout.RadTextAlignment.Center };para.Children.Add(sp);InlineUIContainer container = new InlineUIContainer();container.UiElement = new Button() { Content = "Button" };container.Height = 25;container.Width = 70;para.Children.Add(container);Section section = new Section() { PageMargin = new Telerik.Windows.Documents.Layout.Padding(10) };section.Children.Add(para);RadDocument doc = new RadDocument() { LayoutMode = DocumentLayoutMode.Paged };doc.Sections.Add(section);SaveFileDialog saveDialog = new SaveFileDialog();saveDialog.DefaultExt = ".pdf";saveDialog.Filter = "Adobe Pdf|*.pdf";bool? dialogResult = saveDialog.ShowDialog();if (dialogResult == true){ using (Stream output = saveDialog.OpenFile()) { provider.Export(doc, output); MessageBox.Show("Saved Successfuly!"); }}