PdfSimpleEport - Encoding of PdfInfo fields (Title,Subject,etc) is incorrect
PdfInfo contains a number of fields that contain meta data about the document. These are displayed in the document properties of Acrobat, or the tab of a web browser (for Title). Currently the static fields (Creator and Producer) are being encoded as HEX values, but the public fields are not. The readers I have tried are not rendering this data correctly. My testing indicates that changing the public fields to also be HEX encoded resolves the issue (e.g. changing the setters to be this[key] = new PdfString(value, true);)
Examples of current rendering:

I also have this problem. It is more visible on Microsoft Edge but happens on all the Browsers.
public static FileContentResult ExportaPdf(Report report, string reportName)
{
FastReport.Export.PdfSimple.PDFSimpleExport pdfSimpleExport = new FastReport.Export.PdfSimple.PDFSimpleExport();
pdfSimpleExport.ShowProgress = true;
pdfSimpleExport.Subject = SanitizeName(reportName);
pdfSimpleExport.Name = SanitizeName(reportName);
MemoryStream stream = new MemoryStream();
report.Report.Export(pdfSimpleExport, stream);
stream.Flush();
report.Dispose();
pdfSimpleExport.Dispose();
stream.Position = 0;
return new FileContentResult(stream.ToArray(), "application/pdf");
}
Result :
Was it really fixed?
The problem still exists in version 2025.1.0. The parts of PDFInfo are included in the pdf. with ‘/Title (/(\254\255 ...’. \254\255 should represent xFEFF and mark the content as UTF-16 BOM. Somehow this seems to be wrong. Here is a C#-function that replaces the wrong characters. The file must then be saved via the memory stream.
PDFSimpleExport pdfExport = new()
{
Title = "My Title",
Subject = "My Subject ",
Keywords = "My Keywords ",
Author = "My Author"
};
MemoryStream pdfMS = new();
report.Export(pdfExport, pdfMS);
pdfMS = FixPdfBom(pdfMS);
File.WriteAllBytes(pdffilePath, pdfMS.ToArray());
report.Dispose();
private MemoryStream FixPdfBom(MemoryStream pdfStream)
{
byte[] pdfBytes = pdfStream.ToArray();
string pdfText = Encoding.Latin1.GetString(pdfBytes);
pdfText = pdfText.Replace(@"(\254\255", "(þÿ"); //þÿ = xFEFF
return new MemoryStream(Encoding.Latin1.GetBytes(pdfText));
}
Hello!
Thank you for your appeal!
Reproduced similar behaviour, created a task and passed it to our development department, expect changes in the next versions of FastReport Community Edition
Best regards, Bogdan
Our developers have managed to solve the problem you reported. Please expect changes in the next versions of FastReport OpenSource.
Best regards, Bogdan