Raddocument Obsolete ?

2 posts, 0 answers
  1. Ian
    Ian avatar
    23 posts
    Member since:
    Jun 2011

    Posted 25 Jul 2012 Link to this post

    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);

    }

     

     

     

     

     

     

     

     

     

     

  2. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 26 Jul 2012 Link to this post

    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.

  3. DevCraft banner
Back to Top