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

Free Support Forum - aspose.com

Format issues while saving to PDF

Hi,

Using the below code to save the Excel file to PDF:
Aspose.Cells.Workbook wb1 = new Aspose.Cells.Workbook(memorystream, new Aspose.Cells.LoadOptions(Aspose.Cells.LoadFormat.Auto));
wb1.Save(destinationFile, Aspose.Cells.SaveFormat.Pdf);

Here are the issues with the printed PDF:
1. Underline is breaking, which was set across a sentence
2. Wrapped text is not printing properly. Only the first line is printing.
3. Printing numbers (zeros - display format set as hyphen) as text format i.e., left aligned
4. Repeated rows having thick bottom border is printing in multiple pages with different thickness

Hi,

Thanks for your posting and using Aspose.Cells.

Please provide us your source xls/xlsx file and the output pdf. We will look into this issue and update you asap.

Please also download and try the latest version: Aspose.Cells for .NET (Latest Version) and see if it resolves your issue.

Hi,


Attached is the Excel and the generated PDF file.
The issue is not resolved by using v 7.7.1.4.


Hi,


Please find the additional files “File.xlsx” and “File.pdf”. Here, you can find the breaks in underline, issue with wrapped text and header (repeated lines) bottom border, where thickness is reducing across pages.

Hi Nicole,

Thank you for providing your sample spreadsheet.

We are able to observe three problem while converting your provided spreadsheet to PDF format using the latest build of Aspose.Cells for .NET 7.7.1.4. Please find below the details for the tickets logged in reference to the found issues,

  1. CELLSNET-42342: Underline is breaking after the first occurrence of comma (,) in the text.
  2. CELLSNET-42343: Wrapped text isn’t rendering properly in the resultant PDF, seems like the second line is omitted completely.
  3. CELLSNET-42344: Header border (repeating) has different thickness in first page of the resultant PDF as compared to the subsequent pages.

Please spare us little time to properly analyze the problem cause on our end, and to provide a fix at earliest. In the meanwhile, we will keep you posted with updates in this regard.

We are sorry for your inconvenience.

Hi Nicole,

Thanks for using Aspose.Cells.

For your issue CELLSNET-42343 related to wrap text problem, please use the following code. It should fix your issue.

C#


Workbook wb = new Workbook(srcFile);

foreach (Worksheet ws in wb.Worksheets)

{

ws.AutoFitRows();

}

wb.Save(“outFile.pdf”);

The issues you have found earlier (filed as CELLSNET-42342;42344) have been fixed in this update.


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

Hi,


We are seeing some issues while generating pdf from excel using aspose when it has a wrapped text.

Please find the input excel and the output pdf attached.

Let us know if you need any more details.

Thanks.

Hi Nicole,

Thanks for using Aspose.Cells.

We were able to observe this issue. There are formatting issue when the text is wrapped. It does not match exactly with the MS-Excel Print Preview.

We have tested it with the following code and attached the output pdf for a reference. We have logged this issue in our database for investigation. We will look into it and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as CELLSNET-42400.

C#


Workbook wb = new Workbook(“Input.xlsx”);

wb.Save(“outFile2.pdf”);

Hi Nicole,


I think, currently, as a workaround, you may try to auto-fit your columns in the worksheet in merged cells, it will work fine for your requirements.
e.g
Sample code:

Workbook wb = new Workbook(“e:\test2\Input.xlsx”);
AutoFitterOptions options = new AutoFitterOptions();
options.AutoFitMergedCells = true;
wb.Worksheets[0].AutoFitColumns(options);
wb.Save(“e:\test2\outFile3.pdf”);


We will also evaluate (as we have already logged a ticket “CELLSNET-42400” for it into our database) if you could enhance the Excel to PDF conversion further to accommodate the merged cells if possible.

Thank you.

Hi team,

The data in the excel sheet is being trimmed to next page after converting it into pdf using aspose. Where as when we tried to see the data in excel after print preview and converting it to pdf through excel's inbuilt pdf converter it shows in same page.

Feel free to revert for any questions.

Thanks,

ey global:

Hi team,

The data in the excel sheet is being trimmed to next page after converting it into pdf using aspose. Where as when we tried to see the data in excel after print preview and converting it to pdf through excel's inbuilt pdf converter it shows in same page.

Feel free to revert for any questions.

Thanks,

Hi,

Thanks for your posting and using Aspose.Cells.

Please auto fit the first column and then this issue will be resolved. Please see the following code for your reference.

I have attached the output pdf for your reference.

C#
Workbook workbook = new Workbook("input.xlsx");
workbook.Worksheets[0].AutoFitColumn(0);
workbook.Save("output.pdf");

ey global:
Hi,

We are seeing some issues while generating pdf from excel using aspose when it has a wrapped text.

Please find the input excel and the output pdf attached.

Let us know if you need any more details.

Thanks.

Hi,

Thanks for your posting and using Aspose.Cells.

For your issue logged as CELLSNET-42400, please use the following code to get the same results as MS-Excel.

C#
Workbook wb = new Workbook(srcFile);
AutoFitterOptions options = new AutoFitterOptions();
options.OnlyAuto = true;
wb.Worksheets[0].AutoFitColumns(options);
wb.Worksheets[0].AutoFitRows(options);
wb.Save("outFile.pdf");

Hi Team,
The solution works fine when the data can be accommodated in that particular row. But when it exceeds the row width then it trims the extra data and doesn’t display them in the next page. Thanks.



Hi Team,
The solution works fine when the data can be accommodated in that particular row. But when it exceeds the row width then it trims the extra data and doesn’t display them in the next page.

Thanks,

Hi,

Thanks for your posting and using Aspose.Cells.

We were able to observe this issue. The following code generates the pdf but the row data is trimmed and does not go to next page either. We have logged this issue in our database for investigation. We will look into it and fix this issue.

Once, the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as CELLSNET-42423.

C#


Workbook wb = new Workbook(“input.xls”);

AutoFitterOptions options = new AutoFitterOptions();

options.OnlyAuto = true;

wb.Worksheets[0].AutoFitColumns(options);

wb.Worksheets[0].AutoFitRows(options);

wb.Save(“outFile.pdf”);

Team,
Can you please let us know as to when this issue will be resolved.

Thanks,
Vikas KM

Hi Vikas,

I am afraid, we currently do not have any updates on the ticket logged earlier as CELLSNET-42423. A note has been recorded for the concerned development team member to provide the ETA at earliest. As soon as some news comes in, we will post here for your kind reference.

Please accept our sincere apologies for the inconvenience caused.

Hi team,

Can you please let us know by when we can expect a response to this issue as this is a high production defect.

Hi Vikas,

Thanks for your posting and using Aspose.Cells.

We are afraid, there is no update for you regarding this issue at this moment. However, we have logged your comments in our database and requested the development team to provide some update or ETA for this issue. Once, there is some fix or news for you, we will let you know asap.