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

[ERROR] LibreOffice/OpenOffice .docx files HtmlFormatProvider Export

1 Answer 89 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
J
Top achievements
Rank 1
J asked on 31 Oct 2016, 07:54 AM
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

1 Answer, 1 is accepted

Sort by
0
Mihail
Telerik team
answered on 01 Nov 2016, 12:04 PM
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.
Tags
General Discussions
Asked by
J
Top achievements
Rank 1
Answers by
Mihail
Telerik team
Share this question
or