When printing a report from syncfusion document editor, the output is low quality,

Hi!,

How can I print from syncfusion's Document Editor in high quality?

Attachment: Document_dbf25fa0.zip

6 Replies

HC Harini Chellappa Syncfusion Team April 3, 2020 06:57 AM UTC

Hi Juan, 

Syncfusion Greetings! 

Since Document editor converts canvas as image for printing, its quality is not high. To print the document editor content with high quality, you can follow the below work around. 

In preview window, we will view the pdf document and you can print that document. 

We have override Ctrl+P shortcut, and when pressing this shortcut, we have passed the document editor content to server-side for converting it as PDF with the help of DOCIO. 

For your reference, we have prepared the sample. Kindly check it from the below link. 



Please let us know if you need any further assistance on this. 

Regards, 

Harini C 



JC Juan carlos April 3, 2020 08:07 PM UTC

Thanks for anskwer me, i've two question: 

Can i fix it in the front-end, or i need use the logic in the back-end?

I tried use your example the front-end, but i had a problem when save a blob, is necessary use DOCIO for this?

Attachment: Screenshot_2_1a130341.zip


JC Juan carlos April 4, 2020 01:43 AM UTC

Hi!, Can you help me with an example in c#.net?



 please


HC Harini Chellappa Syncfusion Team April 6, 2020 04:35 AM UTC

Hi Juan, 

Currently, document editor doesn’t provide client-side support for converting document editor content to PDF. We have to achieve this in server-side with the help of DOCIO. we have already shared the backend project which is in ASP.NET Core. 


Sample code snippet which converts docx document to PDF. 

        [HttpPost] 
        [Route("DocToPDF")] 
        public string DocToPDF(string fileName) 
        { 
            Stream stream = new MemoryStream(); 
            IFormFile file = HttpContext.Request.Form.Files[0]; 
            file.CopyTo(stream); 
            stream.Position = 0; 
            Syncfusion.DocIO.DLS.WordDocument wordDocument = new Syncfusion.DocIO.DLS.WordDocument(stream, Syncfusion.DocIO.FormatType.Docx); 
            //Instantiation of DocIORenderer for Word to PDF conversion 
            DocIORenderer render = new DocIORenderer(); 
            //Converts Word document into PDF document 
            PdfDocument pdfDocument = render.ConvertToPDF(wordDocument); 
            MemoryStream ms = new MemoryStream(); 
            //Saves the PDF file             
            pdfDocument.Save(ms); 
            string  base64String = Convert.ToBase64String(ms.ToArray()); 
            string base64 = String.Format("data:application/pdf;base64," + base64String); 
            //Closes the instance of PDF document object 
            render.Dispose(); 
            wordDocument.Dispose(); 
            pdfDocument.Dispose(); 
            ms.Close(); 
            return base64String; 
        } 

Please refer the below DocIO documentation on converting docx to PDF. 


Please let us know if you need any further assistance on this. 

Regards, 

Harini C 



TN Tong Nguyen October 4, 2020 03:57 AM UTC

when i download as docx had a problem with table. It's make spacing between line in table in word is bigger than in editor. :((. 


HC Harini Chellappa Syncfusion Team October 5, 2020 05:54 AM UTC

Hi Juan, 

Can you please share the word document in which you are facing issue on saving? It will be helpful for us to check further on this. 

Regards, 

Harini C 


Loader.
Up arrow icon