Losing formatting when saving to pdf

Hi,

I used the document editor component to save the SFDT object as pdf in our filesystem:


[AcceptVerbs("Post")]
    [HttpPost]
    [EnableCors("AllowAllOrigins")]
    [Route("DocToPDF")]
    public StatusCodeResult DocToPDF([FromBody] Models.ExportData Data)
    {
      string customPath = Environment.GetEnvironmentVariable("CUSTOM_PATH");
      try
      {
        Stream document = WordDocument.Save(Data.documentData, FormatType.Docx);
        document.Position = 0;
        Syncfusion.DocIO.DLS.WordDocument wordDocument = new Syncfusion.DocIO.DLS.WordDocument(document, Syncfusion.DocIO.FormatType.Docx);
                

        DocIORenderer renderer = new DocIORenderer();
        renderer.Settings.AutoDetectComplexScript = true;
        renderer.Settings.AutoTag = true;
        renderer.Settings.EmbedFonts = true;
        renderer.Settings.EmbedCompleteFonts = true;
        renderer.Settings.ExportBookmarks = Syncfusion.DocIO.ExportBookmarkType.Headings;
        renderer.Settings.PdfConformanceLevel = PdfConformanceLevel.Pdf_A3B;
        PdfDocument pdf = renderer.ConvertToPDF(wordDocument);
        wordDocument.Close();
        string path = Data.fullPath == true ? Data.fileName : customPath + Data.fileName;
        FileStream fileStream = new FileStream(path, FileMode.Create, FileAccess.ReadWrite);
        pdf.Save(fileStream);
        pdf.Close(true);
        fileStream.Close();
        document.Dispose();
        return Ok();
      }
      catch (Exception ex)
      {
        return BadRequest();
      }
    }

when SFDT is saved as pdf it is losing formatting one of the cases is line spacing.


line spacing 2 in document editor:

Screenshot 2021-07-20 at 09.21.25.png

pdf generated without the formatting:

Screenshot 2021-07-20 at 09.22.47.png


Versions:

Dotnet core 5

Syncfusion  19.1.0.65


12 Replies

SM Suriya Murugan Syncfusion Team July 21, 2021 09:47 AM UTC

Hi Lucas, 

Syncfusion Greetings! 

We can reproduce the reported issue. Currently, we are validating and get back to you by July 23,2021. 

Regards, 
Suriya M. 



SM Suriya Murugan Syncfusion Team July 23, 2021 12:24 PM UTC

Hi Lucas, 
 
We need some additional timeline to validate the reported issue. We will update further details July 27,2021. 
 
Regards, 
Suriya M. 



SM Suriya Murugan Syncfusion Team July 28, 2021 03:48 AM UTC

Hi Lucas, 

We have confirmed the reported issue as bug and logged the defect report. We will fix this issue and include in our EJ2 patch release which scheduled on August 25,2021. 

You can track the status of bug through below feedback link: 


Regards, 
Suriya M. 



SM Suriya Murugan Syncfusion Team August 25, 2021 07:46 AM UTC

Hi Lucas, 

We are glad to announce that our patch release (v19.2.57) is rolled out successfully and In that release, we have added the fix for reported issue.      

Please upgrade to the latest version packages to resolve this issue.              

Server side:      
Core:      

MVC:                

Release notes: 


Regards, 
Suriya M. 



LL Lucas Lima August 25, 2021 08:45 AM UTC

Thank you!!



SM Suriya Murugan Syncfusion Team August 25, 2021 11:27 AM UTC

Hi Lucas, 
 
Thanks for your update. 
 
Regards, 
Suriya M. 



LL Lucas Lima February 17, 2022 10:43 PM UTC

Hi Suriya, 

We got the same error when we convert the docx to pdf as you can see in the screenshots attached. Version 19.4.0.52.


best regards,


Lucas Lima





Attachment: pdf.pdf_fe03441a.zip


LL Lucas Lima February 17, 2022 10:44 PM UTC

missing attach.


Attachment: Archive_2d533a58.zip


SM Suriya Murugan Syncfusion Team February 21, 2022 08:59 AM UTC

Hi Lucas,


We will check and update details by February 21, 2022.


Regards,

Suriya M.



AE Ajithamarlin Edward Syncfusion Team February 21, 2022 05:52 PM UTC

Hi Lucas,


We tried to reproduce the reported issue at our end by using provided document, But we couldn’t


Please share us the docx file and the save code snippet that you have used at your end to convert to PDF. And also share document editor version details. It may help us to validate this issue further and provide you the solution at the earliest.


Regards,

Ajithamarlin E



LL Lucas Lima March 3, 2022 03:01 PM UTC

Hi Ajithamarlin,


sorry for the delay, we solved this using the substitute font method on the web service side.


thank you



SM Suriya Murugan Syncfusion Team March 4, 2022 09:46 AM UTC

Thanks for your update.


Loader.
Up arrow icon