This is a migrated thread and some comments may be shown as answers.

Export to PDF of InlineUIContainer not working

1 Answer 22 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bjorn
Top achievements
Rank 1
Bjorn asked on 10 Nov 2011, 04:34 PM

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!");
    }
}

 

 

1 Answer, 1 is accepted

Sort by
0
Bjorn
Top achievements
Rank 1
answered on 10 Nov 2011, 04:42 PM
Sorry, please close this thread. I had the latest Telerik installation but didn't upgrade my references. Used the Upgrade Wizard to get the latest references in my project.
Tags
General Discussions
Asked by
Bjorn
Top achievements
Rank 1
Answers by
Bjorn
Top achievements
Rank 1
Share this question
or