I am creating an Excel spreadsheet using Apose.Cells. I set the format of the page to Legal Landscape, and I set a percentage to shrink the spreadsheet to fit the page exactly. Everything works fine. I'm now trying to convert this to a PDF, but the format is off. The spreadsheet doesn't fill the page like it does in Excel. Is there something that I need to set to get this to work?
The column widths only add up to only 782.6424. This may explain why when the PDF gets rendered, it isn't stretched the full width. Again, in Excel, everything is fine but in Excel it is.
Well, when you convert xls2pdf, the attributes related page orientation and size (in excel file) will be documented and rendered with specific page width and height accordingly. So, there might be a subtle difference in the generated .pdf file if you talking about exact page size. Anyways, we will look into it and further improve it (to make it similar to xls) soon.
I tried this DLL, but I still find the same result. The page is rendered only filling about 75% of the width of the PDF. I looked at the raw XML and found the columns widths to be exactly the same as before.
We test this issue again.The columns widths are larger than before.
In the output xml with the current 4.5.1.0 version ,the total columns width is 890 pt,the margins width is 72 pt, the page width is 1008 pt. We will look into how to extend the total columns width as 936pt(1008- 72). It seems the displayed column width in the MS Excel is not same as the printed column width.
I'm still finding the same total width of 782.6424 when I do my testing and look at the XML using 4.5.1.0. 890 pt would at least be an improvement. I wonder why it's not working for me.
Please remove all Aspose.Cells.dll files in your machine ,dowload the fix in the previous post,check this issue again. If you still get the same result,please creat a simple project and post it here. We will check it soon.The following is table option in xml file in my test project.
I managed to fix the PDF width by adjusting the zoom specifically for the PDF. Not the best solution, but it works.
I'm having another issue however. When converting to the PDF, I have a few instances where I'm using the SetRowHeight method. This works fine in Excel, but when converting to PDF, the row isn't as tall and some of the content overlaps into the cell below it. I've tried adjusting the row height to be even higher, but the problem still persists.
Could you paste your sample code and post your template .xls, pdf files here. Kindly point out those instances related row heights too, we will check your issue soon.
In Excel, the zoom level is even lower, 54%, but when I print from Excel all is fine. I'm wondering why I'm not getting the same result as shown in Excel in the PDF. Initially I had the 54% zoom for both Excel and the PDF. The Excel sheet is fine, but with the PDF, the width was only about 75% of the page and the header column still was too short causing overlap with the text. I increased the PDF to 67%, which fixed the page width, but the header problem still persists.
Note, I have tried bumping the header height to 100 for the PDF, but I still have the overlap problem. Could it be something with the bottom aligning of the text?
I have attached a snapshot of the header problem. The overlap appears to be sporadic. On the first page it's only this column, the second page has more columns that do this, the 3rd page everything fits and so on. You can also see the amount of space above it has plenty of room to fit the text.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.