Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
4695
Export to PDF of
posted

Dear all,

I am using below code to export List<string> array into PDF. But find that there is a issue as shown in the attached file. It shows different in length in the dotnet debugger and in the PDF. But they are same length when I paste them into notepad. Is there any way to show correctly in the PDF??

Infragistics.Documents.Report.Table.ITable table = section.AddTable();
Infragistics.Documents.Report.Table.ITableRow row = table.AddRow();
                        cell = row.AddCell();
                        text = cell.AddText();
                        text.Style = style1;
                        text.AddContent(printLine);
..................................................................
this.report.Publish(fileName, FileFormat.PDF);

Parents
  • 469350
    Offline posted

    Both Visual Studio and Notepad use a Fixed-Width font (Courier New, I think) by default.

    PDF probably defaults to a variable-width font like MS Sans Serif.

    So change your export code to use a fixed width font like Courier new so that all of the characters are the same width.

Reply Children