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

DOCX to PDF conversion

1 Answer 136 Views
PdfProcessing
This is a migrated thread and some comments may be shown as answers.
Miriam
Top achievements
Rank 1
Miriam asked on 17 Mar 2017, 11:19 PM

Hi, I wonder if you can help with my issue

I have a problem when I try to convert a docx to pdf. The error I get is the following: The type initializer for 'Telerik.Windows.Documents.Fixed.Model.FixedDocumentDefaults' threw an exception

I use the following code:

byte[] renderedBytes2 = null;
                Telerik.Windows.Documents.Common.FormatProviders.IFormatProvider<RadFlowDocument> formatProvider2 = new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider();
                using (MemoryStream memoria2 = new MemoryStream())
                {
                    formatProvider2.Export(document, memoria2);
                    renderedBytes2 = memoria2.ToArray();
                    //string nombre = "EstudioBNF.pdf";
                    GuardarHistoria(nombrepdf, memoria2);
                }

The things to note are:

* No exception is thrown when the project is run from Visual Studio..

*The exception is thrown at runtime

1 Answer, 1 is accepted

Sort by
0
Tanya
Telerik team
answered on 22 Mar 2017, 03:34 PM
Hello Miriam,

We are unaware of a similar issue in the library and I couldn't reproduce it in a sample scenario. Is it possible to share a simple project showing the error along with a sample document which we can use to test the case? Some steps to reproduce the issue will be much appreciated as well.

Regards,
Tanya
Telerik by Progress

Tags
PdfProcessing
Asked by
Miriam
Top achievements
Rank 1
Answers by
Tanya
Telerik team
Share this question
or