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

Free Support Forum - aspose.com

Cells to PDF

I have a cells sheet I convert to xml then bind to pdf then save as pdf..

I have set the pdf sheet to landscape.. before saving

The PDF that is created has no grid lines and it only displays a few columns per page as if it thinks the page size is not landscape..

1. How can I have grid lines displayed

2. How can I tell it that it has more space to render the columns because it is in landscape..

or can I have it make the PDF wide enough to fit all the columns.. or use autosized fonts in the document...


This message was posted using Page2Forum from Dynamically Generate Formatted Excel Reports with an Elegant... - Aspose.Cells for .NET and Java

Hi Von,

1. How can I have grid lines displayed

Well, if you take the preview of the excel file sheet in MS Excel (Click File|Print Preview), you will see that there is no gridlines which you normally see in the Excel environment, it's just for display purpose and for identification and managing each cell's value separately for a user. I think you may add/set borders around the cells for your data in the worksheet. You can manually set borders in MS Excel or use Aspose.Cells APIs to apply borders before saving the .xml file (Aspose.Pdf Integrated file), check the following topics for your reference:



2. How can I tell it that it has more space to render the columns because it is in landscape..

Well, when you convert and excel file to .pdf file with landscape pagesetup attribute, Aspose.Cells try to document the corresponding pages height and width accordingly but you might not get exactly the same landscape settings for the page(s) when the file is rendered to .pdf file format as both Excel and Pdf are different architectures and having their own sets of attributes. We always try to mimic the similar results converting to .pdf file formats.

I think you may try some pagesetup attributes using the Aspose.Cells APIs

e.g.., PageSetup.FitToPagesWide = 1 etc. and further check: http://www.aspose.com/documentation/file-format-components/aspose.cells-for-.net-and-java/setting-page-options.html

If you still find any issue, kindly post your desired template excel file, we will check the conversion.

Thank you.