i have convert excel file to PDFs using dll. but my excel file height will be different.i want to show excel sheet on single page it is possible using
xlWorkSheettax.PageSetup.FitToPagesWide = 1
but my pdf width will be different.
i want to show same width to all pdf
code:-
For Each xlWorkSheettax In taxsheet_workbook.Worksheets
xlWorkSheettax.PageSetup.TopMargin = excel.InchesToPoints(0.2)
xlWorkSheettax.PageSetup.LeftMargin = excel.InchesToPoints(0)
xlWorkSheettax.PageSetup.RightMargin = excel.InchesToPoints(0)
xlWorkSheettax.PageSetup.BottomMargin = excel.InchesToPoints(0.2)
xlWorkSheettax.PageSetup.Orientation = Global.Excel.XlPageOrientation.xlPortrait
xlWorkSheettax.PageSetup.Zoom = False
xlWorkSheettax.PageSetup.FitToPagesWide = 1
xlWorkSheettax.PageSetup.CenterHorizontally = True
Next
in last merge all pdf
If lisPDFMergeCollection.Count > 0 Then
For intPDFCount = 0 To lisPDFMergeCollection.Count - 1
files.Add(lisPDFMergeCollection.Item(intPDFCount).ToString)
files.Sort()
Next
End If
For Each file In files
filesByte.Add(System.IO.File.ReadAllBytes(file))
Next
strMergePDFName = strReportPath & "\" & reportName & "_" & strPSMonth.Trim.ToUpper & "_" & strPSYear.Trim.ToUpper
System.IO.File.WriteAllBytes(strMergePDFName & ".pdf", PdfMerger.MergeFiles(filesByte))