Click here to Skip to main content
15,885,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
VB
If lisPDFMergeCollection.Count > 0 Then
                      For intPDFCount = 0 To lisPDFMergeCollection.Count - 1
                          ' logcreate("Message2_intPDFCount_ " & intPDFCount.ToString)
                          'files.Add(colPDFMergeCollection.Item(intPDFCount + 1).ToString())
                          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))
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900