Issue when converting excel to pdf with scaling set to true

Hi,
I am converting excel to pdf with scaling being set to true. i.e. when user wants scaling, I am setting below fields.
worksheet.AutoFitColumns();
worksheet.AutoFitRows();
var pageSetup = worksheet.PageSetup;
pageSetup.PrintHeadings = true;
pageSetup.Order = pdfPrintOptions.PageOrder;
pageSetup.Orientation = pdfPrintOptions.Orientation;
pageSetup.PaperSize = pdfPrintOptions.PaperSize;
pageSetup.PrintComments = pdfPrintOptions.LocationOfComments;
// Page Setup Auto scaler properties
if (pdfPrintOptions.Scaling == true)
{
pageSetup.FitToPagesTall = 1;
pageSetup.FitToPagesWide = 1;
}
else
{
worksheet.PageSetup.Zoom = 100;
}
pageSetup.BlackAndWhite = pdfPrintOptions.BlackAndWhiteColorMode ?? false;
pageSetup.HeaderMargin = pdfPrintOptions.HeaderMarginOffset;
pageSetup.FooterMargin = pdfPrintOptions.FooterMarginOffset;
pageSetup.PrintGridlines = pdfPrintOptions.Gridlines ?? true;

I can see that after generation of the pdf file some part of the data in few of the columns is truncated. Attaching the Excel file and PDF file below for reference.
Test(2).zip (373.7 KB)

@shreyap

Looks like the inquiry is related to Aspose.Cells. We have moved the topic to respective category where you will be assisted shortly.

@shreyap
We cannot reproduce the issue by testing on the latest version v24.9 using the following sample code and sample files. Please refer to the attachment. result.zip (618.5 KB)

Workbook wb = new Workbook(filePath + "Test (2).xlsx");
Worksheet worksheet = wb.Worksheets[0];
worksheet.AutoFitColumns();
worksheet.AutoFitRows();
var pageSetup = worksheet.PageSetup;
pageSetup.FitToPagesTall = 1;
pageSetup.FitToPagesWide = 1;
wb.Save(filePath + "out_net.pdf");

The pdfPrintOptions object contained in your code snippet is unknown. Would you like to provide runnable console project code? Also, would you like to provide a screenshot and highlight the incorrect areas? This will be very helpful for us to locate the issue. We will check it soon.

@John.He, pdfPrintOptions is an object containing users preferences. We don’t have to worry about it.
image.png (70.2 KB)

The above image is an extract from the pdf I have shared above. I have zoomed it and taken the snippet. As you can see column A,C,D content is truncated. I am supposed to be having 6o’s in each cell(You can compare it with xls file that I have attached above), but pdf has only 3o’s in ach cell.
I am using 24.7.0 version of aspose.cells and aspose.pdf

@shreyap
Could you list your actual value of params of pdfPrintOptions , then we can simply evaluate
your need.
It seems pdfPrintOptions.Scaling is false after checking your image.

@shreyap
Would you like to comment out the following code and test it again? Please let us know your feedback.

//worksheet.AutoFitColumns();

@John.He ,
Can you please in detail let us know the behaviour of autofitRow and autoFitColumn. I am aware of the documentation which says rows and columns are autofitted. But to what size?
And can you please let me know why did you ask me to comment AutoFitColumns():

@shreyap
The text was truncated due to insufficient column width. So after commenting out the code for automatically adjusting column width, all text should be displayed normally. If you can provide complete and executable console code, it will be very helpful for us to locate the issue. We will check it soon.