Aspose.Cells 23.3.0 does not print indents that contain tab characters in PDF when migrating from version 21.6.0

Dear Aspose team,

We have an Excel file that contains different indentation characters in the text in the form of spaces and tabs.
The Aspose.Cells library for .NET is used to print a document file to PDF.
In version 21.6.0, which we are currently using, the document prints both tabs and spaces.
When switching to version 23.3.0, indentations that contain tabs are no longer printed.

  • Could you please tell me how to keep the previous print behavior in the new version?
  • Is the current behavior with ignoring tabs expected when printing?

Below is an example code that is used to print a document:

    /// <summary>
    /// Convert excel file to pdf using Aspose.Cells
    /// </summary>
    /// <param name="srcFileName">input excel file name for conversion</param>
    /// <param name="dstPdfFileName">result pdf file name</param>
    static void ConvertExcelFileToPDF(string srcExcelFileName, string dstPdfFileName)
    {
        var inputStream = File.OpenRead(srcExcelFileName);
        var outputStream = File.Create(dstPdfFileName);

        Workbook workbook = null;
        var options = new LoadOptions();
        workbook = new Workbook(inputStream, options);
        workbook.Settings.ReCalculateOnOpen = false;

        var tmpStream = new MemoryStream();
        var saveOptions = new PdfSaveOptions();
        workbook.Save(tmpStream, saveOptions);
        tmpStream.Seek(0, SeekOrigin.Begin);
        tmpStream.CopyTo(outputStream);

        inputStream.Dispose();
        outputStream.Dispose();
    }

I attached zip archive that contains the input example Excel file ‘Excel_To_Pdf-Tabs_Delimiter_Problem.xlsx’ with a text in a cell A2 and 2 PDF files after conversion with different library versions:

  • 21.6.0 version - ‘Excel_To_Pdf-Tabs_Delimiter_Problem-Aspose_21.6.pdf’
  • 23.3.0 version - ‘Excel_To_Pdf-Tabs_Delimiter_Problem-Aspose_23.3.pdf’

Tabs_Delimiter_Problems_Examples.zip (94.4 KB)

Best regards,
Vitaly Kvashin.

@VitalyKvashin,

Thanks for the template XLSX file.

We reproduced the issue as you mentioned by using your sample XLSX file. We found Aspose.Cells does not print indents that contain tab characters in PDF conversion. We need to investigate your issue in details.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSNET-53689

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@VitalyKvashin

Please check the view in Excel: Screenshot_indent_in_Excel.png (27.2 KB) , the indentations that contain tabs are also ignored, which is same as the result of Aspose.Cells v23.3.

Hi @peyton.xu and @amjad.sahi!
Thank you for the quick response.
I see that tabs are not displayed in excel. But our clients expect to see tabs when printing to PDF. Is there any way to keep the old print behavior using Aspose.Cells? Maybe there is some setting?

@VitalyKvashin

You may try the following code to replace tab by four spaces.

...
Workbook workbook = null;
var options = new LoadOptions();
workbook = new Workbook(inputStream, options);
workbook.Settings.ReCalculateOnOpen = false;

//replace tab by four spaces.
ReplaceOptions replaceOptions = new ReplaceOptions();
replaceOptions.MatchEntireCellContents = false;
workbook.Replace("\t", "    ", replaceOptions);

var tmpStream = new MemoryStream();
var saveOptions = new PdfSaveOptions();
workbook.Save(tmpStream, saveOptions);
...