Converting Excel to PDF Text Cut Off


#1

Hello, when trying to convert an excel document page that contains text and image to a pdf, the resulting pdf document page has some of the text cut off. Please see attached. Excel page: image.png (64.7 KB)
Resulting Pdf:
image.png (68.3 KB)

Another question, as you can see in the second image, the image is adjusted to the left. How can I make it centered.
Thank you.


#2

@mpogorelov,

Thanks for the screenshots.

Please note, Aspose.Cells does render Excel file to PDF as per the display shown when you take print preview for different sheets in MS Excel manually. Please provide your template Excel file to evaluate your issue precisely to consequently figure it out soon.

PS. please zip the file prior attaching.


#4

Thank you for your response. Here is the zipped file that contains both the original excel and resulting pdf file. pdf.zip (367.0 KB)
Print Preview in excel looks fine: image.png (123.5 KB)

What about centering question from the previous post?
Thank you


#5

@mpogorelov,
We have opened your workbook in Excel 365 and observed that it shows the same print preview as rendered by Aspose.Cells to Pdf. Similarly if we open the page break preview in the Excel, it also shows that text is broken into multiple pages. Could you please confirm that correct file is opened and print preview is shown? Also share the image of page break preview of the same sheet of your sample workbook for our reference.
Excel365PageBreakPreview.PNG (90.8 KB)
Excel365PrintPreview.PNG (87.1 KB)


#6

I am not talking about this page brake, but about the text being cut off:
image.png (49.7 KB)


#7

@mpogorelov,
We were able to observe the issue but we need to look into it more. We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

CELLSNET-47003 – Text is cut when Excel file is converted to PDF


#8

How soon do you think you would have a fix?


#9

@mpogorelov,

Generally, if an issue is not complex, it takes 5-7 days to fix the issue. But if an issue is complex, it might take couple of weeks or even more to figure it out. Please spare us little time to evaluate your issue first. Once we have any new information available, we will share it.


#10

@mpogorelov,

We evaluated your issue further and found it is not an issue with the APIs.
The row height cached is not right. When the source file is opened in Microsoft Excel, Microsoft Excel recalculates the height of rows which are auto height. Please use the following code, it will be ok.
e.g
Sample code:

Workbook wb = new Workbook(BUG_DIR +"excel.xlsx");
foreach(Worksheet sheet in wb.Worksheets)
{
    sheet.AutoFitRows(true);
}

PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
wb.Save(outFile.pdf, pdfSaveOptions);

Let us know your feedback.


split this topic #11

A post was split to a new topic: Issue with inserting a heading above the table


#12

Good to know that your issue is fixed by using the suggested code segment. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.