We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Emulator Xamarin Word to PDF broke the document


we are still testing the Synfusion DocIO and Xamarin and WPF/Winforms Lib.

We using a xamarin-test-app to implament a dll (.net 2.0 with docio) to create a word document.

In emulator mode when we saving the word document with stream and rendering the pdf document the pdf creates 13 pages instead of 1!

When we installing the to normal (not emulatet) device the app runs perfect.

  DataReader dataReader = new DataReader();
            PdfCreator pdfCreator = new PdfCreator();

            string filename = Path.Combine("/storage/emulated/0/Download/", "WPFDatei.docx");
            pdfCreator.SaveApp(pdfCreator.MemoryStream, filename); // <- Save the worddocument to the device storage!
            FileStream fileStream = new FileStream(filename, FileMode.Open, FileAccess.Read);
            WordDocument wordDocument = new WordDocument(fileStream, Syncfusion.DocIO.FormatType.Docx);
            DocIORenderer render = new DocIORenderer();

            render.Settings.ChartRenderingOptions.ImageFormat = ExportImageFormat.Jpeg;
            PdfDocument pdfDocument = render.ConvertToPDF(wordDocument);



            MemoryStream outputStream = new MemoryStream();           
            string Pdffilename = Path.Combine("/storage/emulated/0/Download/", "word.pdf");

            FileStream fileStreamPdf = new FileStream(Pdffilename, FileMode.Create, FileAccess.Write);

            FileStream openPdfStream = new FileStream(Pdffilename,FileMode.Open ,FileAccess.Read);

any idea?

The word document is broken to. Both Files has 13 pages but only in emulator mode on VS 2019!



1 Reply

VA Vijayasurya Anandhan Syncfusion Team July 24, 2019 04:19 AM

Hi Christian,

Thank you for contacting Syncfusion support.

On further analysing the shared details, we suspect that the font used in the Word document may be available in the emulator which might cause the issue with “Extra pages are available in the generated PDF in emulator alone”.

To overcome this issue, we request to check whether the font used in the Word document is installed in the emulator, if not so please install the missing font and perform conversion.

If you face difficulties to install the font, we request to use our font substitution feature. Please find the sample from the below link.

If you still face issue, we request to share the below details to reproduce the issue in our end which will be helpful for us to proceed further in this.

          1. Sample with complete code snippet in which you are facing issue.
          2. Input Word document

Please let us know if you have any questions.  

Vijayasurya A

Live Chat Icon For mobile
Up arrow icon