We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

PDF different when saved from Excel and Cells

Hi,

I have some layout problems when converting my excel files to PDF using Cells. The result is different when the pdf file i saved from Excel and from Aspose.Cells (.net). All our files are formatted/setup for print and excel converts to pdf within the print areas nicely, whereas Cells exceeds the print area for some text cells. It trouble maker seems to be the font, or its size, that is causing the layout problem.

My code simple takes the excel files loads the Workbook, and saves it right after with SaveFormat.Pdf - am i missing something?

I have attached the excel file and the pdf files saved by excel and cells (version 6.0 and latest 7.3). If you look at worksheet [2. Indstilling] row 3 it is easy to see the difference in the pfds generated by excel and cells.
(Only the worksheets starting with a number is relevant for this issue!)

TIA, Frank

I've had success using the following code:

var options = new PdfSaveOptions
{
OnePagePerSheet = true
};

workbook.Save(path, options);

frank.nielsen:
Hi,

I have some layout problems when converting my excel files to PDF using Cells. The result is different when the pdf file i saved from Excel and from Aspose.Cells (.net). All our files are formatted/setup for print and excel converts to pdf within the print areas nicely, whereas Cells exceeds the print area for some text cells. It trouble maker seems to be the font, or its size, that is causing the layout problem.

My code simple takes the excel files loads the Workbook, and saves it right after with SaveFormat.Pdf - am i missing something?

I have attached the excel file and the pdf files saved by excel and cells (version 6.0 and latest 7.3). If you look at worksheet [2. Indstilling] row 3 it is easy to see the difference in the pfds generated by excel and cells.
(Only the worksheets starting with a number is relevant for this issue!)

TIA, Frank
Hi,

Thanks for your posting and using Aspose.Cells for .NET.

After initial investigation, we were able to notice some of your issues. However, in order to fix these issues precisely and in better way, please provide us screenshots highlighting all of them with red circles.

Thanks for your cooperation.

Below is the test code used. I have also attached the output pdf for your reference.

C#
string filePath = @"F:\Shak-Data-RW\Downloads\1766_Stottefastsættelse.xls";

Workbook workbook = new Workbook(filePath);
workbook.Save(filePath + ".out.pdf", SaveFormat.Pdf);


mogro:

I've had success using the following code:

var options = new PdfSaveOptions
{
OnePagePerSheet = true
};

workbook.Save(path, options);

Hi,

Thanks for your posting and using Aspose.Cells for .NET.

This option invalidates the PrintArea and print the entire worksheet as a single page inside the pdf.

Please check this article for your more help.

Thanks for fast response :)

I have attached you pdf with some highlights and comments. But if you compare the excel pdf and cells pdf then notice the different font or its size, which i think is the general problem.

Meanwhile i have noticed an option in the Excel -> Print -> PageSetup. Under Scaling, there is an "Adjust to:" which is set to 95%. i have attached a screenshot. I've tried setting worksheet.PageSetup.Zoom = 95; but it seems to have no effect on the pdf output.

TIA, frank
frank.nielsen:
Thanks for fast response :)

I have attached you pdf with some highlights and comments. But if you compare the excel pdf and cells pdf then notice the different font or its size, which i think is the general problem.

Meanwhile i have noticed an option in the Excel -> Print -> PageSetup. Under Scaling, there is an "Adjust to:" which is set to 95%. i have attached a screenshot. I've tried setting worksheet.PageSetup.Zoom = 95; but it seems to have no effect on the pdf output.

TIA, frank
Hi,

Thanks for your input.

Actually, Aspose.Cells can render Ms-Excel workbooks at 100% scaling or zoom. It is a limitation of Aspose.Cells at present.

Could you please try getting the pdf on 100% settings and let us know your run results?

I have generated a new Excel PDF with 100% scaling (meaning no scaling), and the result is bias. Now the excel pdf exceeds page height, but the text shows no difference. All texts are still nicely printed inside print area/borders. There are still difference in font or size between excel pdf and cells pdf.


TIA, frank
frank.nielsen:
I have generated a new Excel PDF with 100% scaling (meaning no scaling), and the result is bias. Now the excel pdf exceeds page height, but the text shows no difference. All texts are still nicely printed inside print area/borders. There are still difference in font or size between excel pdf and cells pdf.

TIA, frank
Hi,

Thanks for your feedback.

I have looked into your issue. Now, there seems to be no issue except the font size issue. This is a minute difference and not readily visible. I think, it will not be fixed because very small difference of fonts (sizes) occurs because of the difference between Aspose.Cells and Ms-Excel way of fonts handling.

Aspose.Cells uses .NET Managed API(s) while Ms-Excel uses the Win32 Unmanaged API(s).

If you think, there is a huge difference, then please highlight your issues, we will look into them and fix them.

You will now have to adjust your page breaks to make your text fit in a single page height with 100% scaling and zoom.

Screenshot:

Are your second screenshot produced by Cells ? I still have “m.v. §” on second line when the pdf i generated by Cells (see attached) also still having the highlighted issues (cutted text) as reported in previous Cells generated pdf.


If you can do a fix where it is possible to adjust font size/zoom/scale, so the pdf file will be equal to excels pdf file i (and properly other) really will appreciate that :slight_smile:

TIA, frank
frank.nielsen:
Are your second screenshot produced by Cells ? I still have "m.v. §" on second line when the pdf i generated by Cells (see attached) also still having the highlighted issues (cutted text) as reported in previous Cells generated pdf.

If you can do a fix where it is possible to adjust font size/zoom/scale, so the pdf file will be equal to excels pdf file i (and properly other) really will appreciate that :)

TIA, frank
Hi,

Thanks for your feedback and using Aspose.Cells.

Could you please provide us Attachment: 1766_Cells_Støttefastsættelse_test.pdf (since this file is taken with 100% zoom and scaling etc) with comments too?

It will help us fix your issues better.

We will look into your issues and help you asap.
frank.nielsen:
Are your second screenshot produced by Cells ? I still have "m.v. §" on second line when the pdf i generated by Cells (see attached) also still having the highlighted issues (cutted text) as reported in previous Cells generated pdf.

If you can do a fix where it is possible to adjust font size/zoom/scale, so the pdf file will be equal to excels pdf file i (and properly other) really will appreciate that :)

TIA, frank
Hi,

To update you further, we do support PageSetup.Zoom, so we can fix page split issue as you mentioned in this thread, however text cut issue can not be fixed soon.

You can look at excel print preview and editor view, they are much different when handling long text.

In editor view, long text is cut, but in print preview, the text is not cut.

We have logged this issue in our database. We will investigate and fix this issue. Once, this issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as CELLSNET-41283.

Thanks, i really appreciate that.


I have attached your requested file.

A general question, are we the only one having this problem? If so, is it caused by the font (verdana) being used or? Also, if your are still working with this sample file http://www.aspose.com/docs/display/cellsnet/Converting+to+PDF+Files i guess that it will be possible to reproduce the same problem.

TIA, frank
frank.nielsen:
Thanks, i really appreciate that.

I have attached your requested file.

A general question, are we the only one having this problem? If so, is it caused by the font (verdana) being used or? Also, if your are still working with this sample file http://www.aspose.com/docs/display/cellsnet/Converting+to+PDF+Files i guess that it will be possible to reproduce the same problem.

TIA, frank
Hi,

Thanks for your feedback and providing us the output file with comments.

It will help us look into and fix your issue precisely. We think, it is not caused by verdana font. We have logged your feedback in our database against the issue id: CELLSNET-41283.

Once, we will have some update for you, we will share it with you asap.

Hi,


Please try our latest version/fix: Aspose.Cells for .NET v17.1.3 (attached).
  • Aspose.Cells for .NET v17.1.3 (.NET 2.0)
  • Aspose.Cells for .NET v17.1.3 (.NET 4.0)

(Note: please choose any of the fixes for your underlying .NET framework version).

Your issue (logged earlier as “CELLSNET-41283”) should be fixed in it.

Let us know your feedback.

Thank you.

The issues you have found earlier (filed as CELLSNET-41283) have been fixed in Aspose.Cells for .NET 17.2.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan