I am try to convert xlsx and xls to pdf with one column excel sheet ,it show like below
if i try in 3 columns in excel sheet it show like below
and my code is
1.My need is if it is one or more than one column i need pdf in full sheet(A4 or like second link)i dont want like single column pdf ,(i point out the white space).
If u open convert pdf,left and right u can see gray color and middle have white ,i need full white color and left side need that one column (if have one column in excel sheet)
2.I am use Aspose.Total license,still i got water mark on top of the page.in 3rd link i will comment license line but that screen shot take before comment license line(i mean with license i will convert xls to pdf)
Pls reply asap
Thank you for contacting Aspose support.
First of all, please provide your problematic sample spreadsheet for our review. We need to see what PageSetup settings have been to applied on that particular spreadsheet. Please note, when PdfSaveOptions.AllColumnsInOnePagePerSheet is not specified or set to false, the API will render the PDF according to the paper size set in the PageSetup configurations. When the aforesaid property is set to true, the PageSetup’s PaperSize settings are ignored, and the API will render all the worksheet columns on one page (rows may span to several pages). The later option may reduce the paper size if there are less columns in the worksheet & vice versa.
Regarding the licensing problem, could you please try by placing the license file on a simple path location, such as root of any drive? In case the problem persists without the SetLicense method throwing any exception, please send us your license file. Please do not attach the license file to the post, instead use the contact button on the post window to send an email to babar.raza, and attach the license file to it. Once you have sent the license file using the method stated above, please notify us here.
We will check the issue(s) in more details as soon as we receive the information as requested above.
Thank u for ur reply
Actually if i use this line then it work what i expect
Dim dataDir As String = Path.GetFullPath(“…/…/…/Data/”)
Dim workbook As New Workbook(dataDir & “Book1.xls”)
workbook.Save(dataDir & “outBook1.pdf”, SaveFormat.Pdf)
May be one time i ask how to concat all column as one pdf,bcz if i see print preview each page got each column,so i use that code to convert into one pdf page.
Thank you for writing back.
The main difference in your provided code snippet, and the snippet shown in the screen shot is the second parameter for the Workbook.Save
method. The code shown in the image is missing the SaveFormat
. However, I have tested on my end by not passing the second parameter to the Workbook.Save
method, and I have got the correct results. By the way, I have tested the scenario with the latest version of Aspose.Cells for .NET 18.104.22.168
. Please give the latest version a try on your end. In case the problem persists, please provide the sample spreadsheet for our review.