Please confirm that you have shared the correct spreadsheet for our testing. We have checked the provided spreadsheet in Excel 2007, and it has two pages when set to print in Landscape. Please check the attached snapshot for your reference.
I’m sure that I have given the right Excel file. I have downloaded and opened it again in Microsoft Excel 2007. You can see some snapshot in my printing test and the result of printing with CutePDF WriterPrinter (in pdf format).
But the convert pdf seems to be always generated in Portrait layout, not in Landscape layout.
I am afraid, I am still getting two PDF pages for your provided spreadsheet even when it is exported out via MS Excel 2010. Please check the attached resultant PDF file for your reference. However, when we tested the same scenario with Aspose.Cells for .NET API, we are able to print only one PDF page in landscape. We are currently looking into this matter further to propose a solution, and we will shortly get back to you with updates in this regard.
We have tested the Cloud API with following PdfSaveOptions and have received the desired results, that is; the resultant PDF has only one page printed in landscape. Please share your settings for further investigation.
string xml = @"
<-- Pdf property -->
False
False
None
False
90
70
Pdf
";
I have tested it again the the result convert pdf is still in 2 pages. I’m using the PDFSaveOptions as following :
true true false None false Pdf
With that PDFSaveOptions, I have tried to test another Excel file in Portrait mode and the result convert pdf is still in 2 pages. List files : + Test Portrait layout.xlsx + Test Portrait layout.pdf
Thank you for providing the PdfSaveOptions settings and the new samples. Unfortunately, we are getting different results than yours. Please check the attached resultant PDF files generated from your recently provided spreadsheets. You will notice that both PDF files contains only one page. We are not sure at the moment why the behavior is different on your side. In order to further investigate the matter, please provide us your complete code (in an archive) after uploading the sample spreadsheets to your cloud storage. Please also send us your AppSID & AppKey by using the contact button on the post window to send an email to babar.raza, and attach the requested information with it. Please note, sharing the AppSID & AppKey information on the forum threads is not allowed, so please use the mechanism shared above.
Thank you for your kind support. I can show you the scenario codes (extract from my Java codes) about using Aspose.Clouds for converting pdf file from Excel Spreadsheets, includes : + Upload file Excel + Save Excel file into PDF format (directly on Aspose’s server) + Download the result PDF.
You can see the detail from function in file AsposeCellsUtils.java : public static byte[] getPdfDownloadData(byte[] inputExcel, String extension) throws Exception { … …
I’m afraid I can’t share you the information about AppSID & AppKey because of security reasons.
We are able to replicate the problem of multiple PDF pages with your provided spreadsheets & code snippet. The problem was replicated by using the overloaded version of ProcessCommand method (available in Aspose for Cloud Java SDK) accepting four parameters, where fourth parameter is the ContentType. We have noticed that when aforesaid parameter is set to “XML” (setting the request property Content-Type to application/xml) the generated PDF contains two pages. Please note, the saveAs resource controller used in this scenario does not support JSON Content-Type yet, therefore the Content-Type should always be XML (default). However, you can avoid the generation of multiple page generation by setting the OnePagePerSheet property to true in your XML for your provided spreadsheets.
We will further investigate why we are getting 2 page PDF with OnePagePerSheet set to false & ContentType set to XML, and post our findings here for your reference.
With your suggestion, I can resolve the current issue. But the convert pdf should have the same layout as Excel spreadsheet layout in printing preview when OnePagePerSheet = false.
I’m waiting for your further investigations about this issue.
Good to know that you can bypass the problem for now. We are investigating the matter in more detail to bring you updates in this regard. We will keep you posted.
We have logged the problem discussed here as a bug in our database for further investigation & correction purposes. The ticket Id for your future reference is SAASCELLS-99. Please spare us little more time for thorough investigation to provide you the fix for it. In the meanwhile, we will keep you posted with updates in this regard.