[ERROR] LibreOffice/OpenOffice .docx files HtmlFormatProvider Export

2 posts, 0 answers
  1. J
    J avatar
    6 posts
    Member since:
    Oct 2016

    Posted 31 Oct Link to this post

    Hi;
    I'm having problems, when I try to export with HtmlFormatProvider the OpenOffice/LibreOffice docx files.
    If the file is created with MSWord there's no problems, all works fine, the problem is with LibreOffice/Openoffice generated-documents.
    Please, I need help 'cause some of my customers uses LibreOffice to create the docx documents.
    +++++++++++++++++++++++ CODE ++++++++++++++++++++++++++
                    docxProvider = new DocxFormatProvider();
                    htmlProvider = new HtmlFormatProvider();

                    if(this._DocXByteArray == null)
                        this._DocXByteArray = System.IO.File.ReadAllBytes(this._DocXPath);

                    document = docxProvider.Import(this._DocXByteArray);
                            
                    htmlProvider.ExportSettings.DocumentExportLevel = DocumentExportLevel.Fragment;
                    htmlProvider.ExportSettings.ImagesExportMode = ImagesExportMode.Embedded;
                    htmlProvider.ExportSettings.StylesExportMode = StylesExportMode.Embedded;
                            
                    string html = htmlProvider.Export(document); //heres crash with the down error trace
    +++++++++++++++++++++++ CODE ++++++++++++++++++++++++++
    I'm always getting this error
    ++++++++++++++++++++++++ ERROR TRACE ++++++++++++++++++++++++
      at Telerik.Windows.Documents.Flow.FormatProviders.Html.Model.Elements.ParagraphElementBase.GetDefaultStyleId(IHtmlExportContext context, String& styleId)
      at Telerik.Windows.Documents.Flow.FormatProviders.Html.Model.Elements.HtmlElementBase.CopyStyleFrom(IHtmlExportContext context, IElementWithStyle element)
      at Telerik.Windows.Documents.Flow.FormatProviders.Html.Model.Elements.ParagraphElementBase.OnBeforeWrite(IHtmlWriter writer, IHtmlExportContext context)
      at Telerik.Windows.Documents.Flow.FormatProviders.Html.Model.Elements.HtmlElementBase.Write(IHtmlWriter writer, IHtmlExportContext context)
      at Telerik.Windows.Documents.Flow.FormatProviders.Html.Model.Elements.HtmlElementBase.WriteContent(IHtmlWriter writer, IHtmlExportContext context)
      at Telerik.Windows.Documents.Flow.FormatProviders.Html.Model.Elements.HtmlElementBase.Write(IHtmlWriter writer, IHtmlExportContext context)
      at Telerik.Windows.Documents.Flow.FormatProviders.Html.Export.HtmlExporter.ExportDocumentFragment(IHtmlWriter writer, IHtmlExportContext context)
      at Telerik.Windows.Documents.Flow.FormatProviders.Html.Export.HtmlExporter.Export(IHtmlWriter writer, IHtmlExportContext context)
      at Telerik.Windows.Documents.Flow.FormatProviders.Html.HtmlFormatProvider.ExportOverride(RadFlowDocument document, Stream output)
      at Telerik.Windows.Documents.Common.FormatProviders.FormatProviderBase`1.Export(T document, Stream output)
      at Telerik.Windows.Documents.Common.FormatProviders.TextBasedFormatProviderBase`1.Export(T document)
    ++++++++++++++++++++++++ END ERROR TRACE ++++++++++++++++++++++++

    Thx
  2. Mihail
    Admin
    Mihail avatar
    192 posts

    Posted 01 Nov Link to this post

    Hello Jorge,

    You can find the answer to this question in the other thread on the same subject. Here is a link: http://www.telerik.com/forums/error-libreoffice-openoffice-docx-files-htmlformatprovider-export

    In future could you please open a single thread for each different question. This way the important information will not be scattered in various threads.

    Regards,
    Mihail
    Telerik by Progress
    Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top