Hi, I am exporting the Excel File to PDF but it's not replicating the Excel Pagesize.
I have a excel with ISO ID-1 (85.60 X 53.98 MM) Papersize; but when I export the pdf is A4 size. How to get the same sized (as of excel) in pdf also.
Try
SetDefaultPrinter(_DEFAULT_ID_PRINTER_NORMAL)
Dim excelEngine As ExcelEngine = New ExcelEngine
Dim application As IApplication = excelEngine.Excel
application.DefaultVersion = ExcelVersion.Excel2013
Dim workbook As IWorkbook = application.Workbooks.Open(PRINT_FILE & ".xlsx", ExcelOpenType.Automatic)
Dim sheet As IWorksheet = workbook.Worksheets(0)
'Converts the particular sheet
Dim converter As ExcelToPdfConverter = New ExcelToPdfConverter(sheet)
Dim pdfDocument As PdfDocument = New PdfDocument()
pdfDocument = converter.Convert()
'Save the pdf file
pdfDocument.Save(PRINT_FILE & ".pdf")
'Dispose the objects
pdfDocument.Close()
converter.Dispose()
workbook.Close()
excelEngine.Dispose()
Catch ex As Exception
' Respond to the error.
MessageBox.Show(ex.Message)
CONTINUE_PRINT_FLAG = False
Finally
GC.Collect()
GC.WaitForPendingFinalizers()
GC.Collect()
GC.WaitForPendingFinalizers()
GC.Collect()
GC.WaitForPendingFinalizers()
End Try
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try