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

Unknow charters when copy/paste text from PDF converted from DOCX

Operating system: Windows 10
Asp.Net Core - Framework: 2.1.1

NuGet
Syncfusion.DocIO.Net.Core: v16.3.0.29
Syncfusion.DocIORenderer.Net.Core: v16.3.0.29

I have this code

[HttpPost]
public IActionResult ToPdf(int id)
{
// _reportTemplate is the attacched file (simple word 2019 file)

// Loads document from stream.
FileStream fileStream = new FileStream(_reportTemplate, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
var document = new WordDocument(fileStream, FormatType.Docx);
//WordDocument document = new WordDocument(stream, FormatType.Automatic);
// Creates a new instance of DocIORenderer class.

DocIORenderer render2 = new DocIORenderer();
// Converts Word document into PDF document.
PdfDocument pdf = render2.ConvertToPDF(document);
MemoryStream memoryStream = new MemoryStream();
// Save the PDF document.
pdf.Save(memoryStream);
render2.Dispose();
pdf.Close();
document.Close();
memoryStream.Position = 0;

return File(memoryStream, "application/pdf", $"Report_{id}.pdf");
}

It render the PDF but when i select the rendered PDF text and then copy paste into notepad, it paste gibberish charters like below

EΣZĂƉƉŽƌƚŝŶŽ͗΂΂/΃΃

Attachment: Report_f246f7e.zip

1 Reply

DB Dilli Babu Nandha Gopal Syncfusion Team January 22, 2019 10:56 AM UTC

Hi Massimo, 

Greetings from Syncfusion. 

We have recently fixed a similar kind of issue and included the issue fix in our latest v16.4.0.42 release which can be downloaded from the following link. 

You can also check the issue in our online sample  

Please let us know if you have any questions. 

Regards, 
Dilli babu. 


Loader.
Live Chat Icon For mobile
Up arrow icon