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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Gibberish charters when copy/paste text from converted word into PDF

Thread ID:

Created:

Updated:

Platform:

Replies:

142045 Jan 16,2019 11:33 AM UTC Jan 21,2019 10:32 AM UTC ASP.NET Core - EJ 2 2
loading
Tags: DocIO
Massimo Giambona
Asked On January 16, 2019 11:33 AM UTC

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ĂƉƉŽƌƚŝŶŽ͗΂΂/΃΃

Massimo Giambona
Replied On January 16, 2019 11:35 AM UTC

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ĂƉƉŽƌƚŝŶŽ͗΂΂/΃΃

Missing the attach

Attachment: Report_dd9947eb.zip

Karthikeyan Chandrasekar [Syncfusion]
Replied On January 21, 2019 10:32 AM UTC

Hi Massimo, 
Greetings from Syncfusion. This issue is fixed in our latest version 16.4.0.47. Can you please upgrade to this version in nuget.org to get this issue fixed. 
 
Regards, 
Karthikeyan   


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

;