cameraright.blogg.se

Pdf merge extension
Pdf merge extension









pdf merge extension
  1. #Pdf merge extension pdf#
  2. #Pdf merge extension install#
  3. #Pdf merge extension code#

'Initialize ExcelToPdfConverter for workbookĭim converter As ExcelToPdfConverter = New ExcelToPdfConverter(workbook) 'Initialize IApplication and set the default application versionĭim application As IApplication = excelEngine.ExcelĪpplication.DefaultVersion = ExcelVersion.Excel2016ĭim workbook As IWorkbook = (filePath, ExcelOpenType.Automatic) Close the instances of PdfDocument, IWorkbook, and dispose the ExcelEngineĭim excelEngine As ExcelEngine = New ExcelEngine PdfDocument document = converter.Convert(settings)

#Pdf merge extension pdf#

Convert the Excel document to PDF with converter settings Settings.LayoutOptions = LayoutOptions.FitAllColumnsOnOnePage Initialize ExcelToPdfConverterSettings and set the layoutĮxcelToPdfConverterSettings settings = new ExcelToPdfConverterSettings() Initialize ExcelToPdfConverter for workbookĮxcelToPdfConverter converter = new ExcelToPdfConverter(workbook) IWorkbook workbook = (filePath, ExcelOpenType.Automatic) IApplication application = excelEngine.Excel Īpplication.DefaultVersion = ExcelVersion.Excel2016 Initialize IApplication and set the default application version

#Pdf merge extension code#

  • Define the ImportPagesFromPDF static method with the following code snippet to import pages from one PDF document into another PDF document.ĮxcelEngine excelEngine = new ExcelEngine().
  • The code snippet given above has static methods declared for the conversion of files of different file formats to PDF document and addition of watermark.
  • If ((fileInfo.Extension = ".jpg") OrElse ((fileInfo.Extension = ".png") OrElse (fileInfo.Extension = ".jpeg"))) Thenĭim loadedDocument As PdfLoadedDocument = New PdfLoadedDocument(stream) 'Convert the Image file into PDF and store it in stream Stream = ConvertWordToPDF(fileInfo.FullName) If ((fileInfo.Extension = ".doc") OrElse (fileInfo.Extension = ".docx")) Then

    pdf merge extension

    'Convert the Word document into PDF and store it in stream Stream = ConvertExcelToPDF(fileInfo.FullName) If ((fileInfo.Extension = ".xls") OrElse (fileInfo.Extension = ".xlsx")) Then 'Convert the Excel document into PDF and store it in stream Stream = ImportPagesFromPDF(fileInfo.FullName) 'Import pages from PDF document and store it into stream 'Get the path of documents into DirectoryInfoĭim directoryInfo As DirectoryInfo = New DirectoryInfo("././Documents/")ĭim document As PdfDocument = New PdfDocumentĭim stream As MemoryStream = New MemoryStreamįor Each fileInfo As FileInfo In directoryInfo.GetFiles PdfLoadedDocument loadedDocument = new PdfLoadedDocument(stream) If (fileInfo.Extension = ".jpg" || fileInfo.Extension = ".png" || fileInfo.Extension = ".jpeg") Convert the Image file into PDF and store it in stream If (fileInfo.Extension = ".doc" || fileInfo.Extension = ".docx") Convert the Word document into PDF and store it in stream If (fileInfo.Extension = ".xls" || fileInfo.Extension = ".xlsx") Convert the Excel document into PDF and store it in stream Import pages from PDF document and store it into stream MemoryStream stream = new MemoryStream() įoreach (FileInfo fileInfo in directoryInfo.GetFiles()) PdfDocument document = new PdfDocument() Get the path of documents into DirectoryInfoĭirectoryInfo directoryInfo = new DirectoryInfo("././Documents/")

  • Include the following namespaces in the Program.
  • The files of different file formats can be merged into a single PDF document only after converting each file to a PDF document.
  • The and to work with Excel documents and convert them into PDF documents.
  • The and to work with the word documents and convert them into PDF documents.
  • #Pdf merge extension install#

  • Install the following NuGet packages as a reference to your.
  • pdf merge extension

  • Create a new C# console application project.
  • Steps to merge files of different file formats into PDF document programmatically in C#: This sample merges an image file, a PDF document, a Word document, and an Excel file into a single PDF document. Using this library, you can merge the documents of different file formats into a single PDF document.

    pdf merge extension

    This library also offers functionality to merge, split, stamp, forms, compress, and secure the PDF files. NET PDF library used to create, read, and edit the PDF documents programmatically without Adobe dependencies. Syncfusion Essential PDF is a feature-rich and high performance.











    Pdf merge extension