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

Raddocument Obsolete ?

1 Answer 121 Views
PDFViewer
This is a migrated thread and some comments may be shown as answers.
Ian
Top achievements
Rank 1
Ian asked on 26 Jul 2012, 03:19 AM

Is RadDocument Obsolete now ?

I recently upgraded to silverlight 5 and Telerik contols 2012.2.607.1050 and i now getting errors recognising my RadDocument/Paragraph/Section code

 

 

RadDocument document =

 

this.CreateDocument();

document.LayoutMode = DocumentLayoutMode.Paged;

document.Measure(RadDocument.MAX_DOCUMENT_SIZE);

document.Arrange(

 

new RectangleF(PointF.Empty, document.DesiredSize));

PdfFormatProvider provider = new PdfFormatProvider();

provider.Export(document, fileStream);

private RadDocument CreateDocument()

{

RadDocument document =

 

new RadDocument();

 

this.CreateChartDocumentPart(document);

 

return document;

 }

 

 

private void CreateChartDocumentPart(Telerik.Windows.Documents.Fixed.Model.RadFixedDocument document)

{

Section section =

 

new Section();

Paragraph paragraph =

 

 

new Paragraph();

 

BitmapImage bi = new BitmapImage();

 

using (MemoryStream ms = new MemoryStream())

{

RadChart1.ExportToImage(ms,

 

new Telerik.Windows.Media.Imaging.PngBitmapEncoder());

bi.SetSource(ms);

}

ImageInline image =

 

new ImageInline(new WriteableBitmap(bi)) { Width = 700, Height = 500 };

paragraph.Inlines.Add(image);

section.Blocks.Add(paragraph);

document.Sections.Add(section);

}

 

 

 

 

 

 

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 26 Jul 2012, 04:11 PM
Hi Ian,

RadDocument is the document that RadRichTextBox uses and it is not obsolete.

RadFixedDocument, however, is the document of RadPdfViewer and as far as I can tell from your post, it is not the one you should use.

You can find a list of the assembly references that RadRichTextBox uses here, while the ones for RadPdfViewer uses are included in this article.

Greetings,
Iva Toteva
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
PDFViewer
Asked by
Ian
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Share this question
or