Save RadDocument in the native format

2 posts, 0 answers
  1. Emin Sadykhov
    Emin Sadykhov avatar
    8 posts
    Member since:
    May 2010

    Posted 09 Jul Link to this post


    I want to store RadDocument object in the database table as byte[]. Is any way do that?

    (I don`t want to use export/import, because seems it is not export all data (ex. don`t export "tracking changes", etc)).

  2. Martin
    Martin avatar
    90 posts

    Posted 10 Jul Link to this post

    Hi Emin,

    We tried to import and export a DOCX document containing revisions (tracking changes) using the DocxFormatProvider and XamlFormatProvider and they were successfully exported, so you can use one of these format providers to export the RadDocument to a byte array.

    Using the XamlFormatProvider:

    private void ExportDocumentToByteArray(RadDocument document)
    	DocumentFormatProviderBase provider = new XamlFormatProvider();
    	byte[] output = provider.Export(document);

    Using the DocxFormatProvider:

    private void ExportDocumentToByteArray(RadDocument document)
    	var provider = new Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.DocxFormatProvider();
    	byte[] output = provider.Export(document);

    In case you are observing something that is not successfully exported, please let us know in order to log it in our backlog and investigate the case.

    I hope you find this information helpful. Please, let me know if there is anything else I can assist you with.

    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
Back to Top