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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Emulator Xamarin Word to PDF broke the document

Thread ID:

Created:

Updated:

Platform:

Replies:

146100 Jul 19,2019 01:17 PM UTC Jul 24,2019 09:19 AM UTC Xamarin.Forms 1
loading
Tags: DocIO
Christian Stutz
Asked On July 19, 2019 01:17 PM UTC

Hi,

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();
            pdfCreator.CreateBMP(dataReader.SimpleData());

            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);

            render.Dispose();
            wordDocument.Dispose();

    

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

            pdfDocument.Save(outputStream);
            FileStream fileStreamPdf = new FileStream(Pdffilename, FileMode.Create, FileAccess.Write);
            outputStream.WriteTo(fileStreamPdf);
            fileStreamPdf.Close();
            outputStream.Close();

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


any idea?


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


Regards

Christian

Vijayasurya Anandhan [Syncfusion]
Replied On July 24, 2019 09:19 AM UTC

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.
https://www.syncfusion.com/downloads/support/forum/146100/ze/WordToPDF-92443992.zip

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.  

Regards,
Vijayasurya A


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon