PRODUCTS   DOWNLOAD PURCHASE SUPPORT BLOG  COMPANY  
 
Key Features
Excel to PDF
Excel to DOCX
Excel to RTF
>>Split and merge PDF
Download trial
Purchase
Online-demo
Documentation
What's New

"Split and merge PDF using C# or VB.Net"

Split and merge PDF using C# or VB.Net

Introduction

     Now let's get to know another benefit of the library. Excel to PDF .Net offers great abilities to split and merge PDF documents. To show how Excel to PDF .Net really lessens the burden of coding, assume that you want convert .xlsx files to PDF and then merge them a one single PDF using C#:


Nuget   Online Demo   Download, 4.2.7.24 (Jul 24th, 2017)



Have a Question?

You have a question, need a support or a code example: ask our support team at support@sautinsoft.com. We will help you quickly and with pleasure.



What «Excel to PDF .Net» can give me:

  1. Save a time and cost of developing of my application. You will need to only add the reference to "SautinSoft.ExcelToPdf.dll" and write 3-4 C# lines to get ability to convert Excel to PDF, RTF, DOCX.

  2. The one product provides me by set of API to convert .xls and .xlsx to PDF, RTF, DOCX at once, split and merge PDF documents.

  3. Because of this is absolutely standalone .Net assembly, I don't need to worry about the availability of Adobe Acrobat, MS Office, OpenOffice or other software on the my client's computers.

  4. The one time price. I pay a one time and can use «Excel to PDF .Net» for a whole life without any additional fees. My license will never expires.

  5. As bonus, I get unlimited technical support during a whole life for free and independently of the date of my purchasing.
        static void Main(string[] args)
        {
            // Merge two PDF files.
            // 1. Let's get a PDF from .xls.
            // 2. Let's merge this PDF with itself.
            ExcelToPdf x = new ExcelToPdf();
            x.PageStyle.PageSize.Letter();
            x.PageStyle.PageMarginTop.mm(5);

            // Set PDF as output format.
            x.OutputFormat = SautinSoft.ExcelToPdf.eOutputFormat.Pdf;

            // Let's convert only 3rd page.
            x.Sheets.Custom(new int[]{3});

            string excelFile = Path.GetFullPath(@"d:\test.xlsx");
            FileInfo pdfFile = new FileInfo(Path.ChangeExtension(excelFile, ".pdf"));
            string singlePdf = Path.Combine(pdfFile.Directory.FullName, "Single.pdf");


            try
            {
                // 1. Convert Excel to PDF.
                x.ConvertFile(excelFile, pdfFile.FullName);
                
                // 2. Merge the PDF file with itself.
                x.MergePDFFileArrayToPDFFile(new string[] { pdfFile.FullName, pdfFile.FullName },
                    singlePdf);

                System.Diagnostics.Process.Start(singlePdf);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.ReadLine();
            }

        }
2. Let's convert Excel file to PDF and next split the PDF document by pages using C#:
        static void Main(string[] args)
        {
            // Split PDF by pages.
            // 1. Let's get a PDF with 3 pages from .xls.
            // 2. Let's split it by 3 PDF files and show them.
            ExcelToPdf x = new ExcelToPdf();
            x.PageStyle.PageSize.Letter();
            x.PageStyle.PageMarginTop.mm(5);

            // Set PDF as output format.
            x.OutputFormat = SautinSoft.ExcelToPdf.eOutputFormat.Pdf;

            string excelFile = Path.GetFullPath(@"d:\test.xlsx");
            FileInfo pdfFile = new FileInfo(Path.ChangeExtension(excelFile, ".pdf"));

            try
            {
                // 1. Let's get a PDF with 3 pages from .xls.
                x.ConvertFile(excelFile, pdfFile.FullName);

                // 2. Let's split it by 3 PDF files and show them.
                // Create a directory for storing separate PDFs.
                DirectoryInfo pdfDir = pdfFile.Directory.CreateSubdirectory("My Pages");
                x.SplitPDFFileToPDFFolder(pdfFile.FullName, pdfDir.FullName);

                // Show result
                FileInfo[] pageFiles = pdfDir.GetFiles("*.pdf");
                Console.WriteLine("Resulting PDF files:\n");
                foreach (FileInfo pageFile in pageFiles)
                {
                    Console.WriteLine(pageFile.Name);
                }
                
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);                
            }

            Console.ReadLine();
        }
If anyone needs a code sample in C#, VB.Net, ASP.Net etc "How to split and merge PDF", email us at support@sautinsoft.com or ask at Online Chat (right-bottom corner of this page). We'll help you certainly!


Requrements and Technical Information

     «Excel to PDF .Net» can be used on 32 and 64-bits platforms with .Net 2.0 and higher. The component doesn't require Microsoft Excel or any other software. It's absolutely standalone and independent library.

Our product is compatible with all .Net languages and supports all Operating Systems where .Net Framework can be used. Note that «Excel to PDF .Net» is entirely written in managed C#.



Reasonable prices

     The library offers developers high quality conversion at reasonably prices. The main point of interest is that «Excel to PDF .Net» is less expensive than all of its more or less popular counterparts. For example, a single license cost $239 with no additional fees or royalties!


Download

To see this functionality firsthand, download the freshest «Excel to PDF .Net» with code examples, 9.15 Mb.

 
 
Products Downloads Support Company
Buy now
Follow us on Google Plus SautinSoft on Facebook SautinSoft on Twitter SautinSoft on Youtube Our Blog
Copyright © 2002 - 2017 SautinSoft (started from sautin.com). All rights reserved.