데스크톱 제품:

프로세스 자동화:

소프트웨어 개발:

 
PDF to Word 변환프로그램 고객
 

Solid Framework Code Sample

This is a concise sample to help get started with Solid Framework SDK

Combine Multiple PDF Files to a Single PDF File

In this tutorial we show you how to combine multiple PDF pages to a single PDF file.

Combine Multiple PDF Files to a Single PDF File

코드 설명하기 비디오 시청하시려면 눌러주십시요

Steps for Combining Multiple PDF Files

  1. Import the trial Developer License:


    License.Import(new StreamReader(@"C:\Users\Joe\license.xml"));

  2. Allow multi selection of only PDF files using OpenFileDialog:


    // Create a Open File Dialog that allows you to select multiple files
    OpenFileDialog OpFile = new OpenFileDialog();
    OpFile.Multiselect = true;

    //show only PDF Files
    OpFile.Filter = "PDF Files (*.pdf)|*.pdf";

    //Do nothing if someone clicks on cancel
    if (OpFile.ShowDialog() != System.Windows.Forms.DialogResult.OK)
    {
    ...

  3. Create a new Solid Framework PagesModel Object:


    //create a new pages model object
    using (PagesModel model = new PagesModel())
    {

  4. Open the selected files with the new model:


    //create a IPageSource for the selected files then add each of the files to one source
    foreach (string filename in OpFile.FileNames)
    {
      // For each file add it to a source and collate them
      SolidFramework.Model.Pdf.Pages.IPageSource source = model.CreateSource(filename);
      model.Insert(model.PageCount, source);
    }

  5. For Each file selected add it to a new source and insert them into a single file:


      // save the new combined file
      model.Save(@"C:\Users\nelson\Documents\combined_pdf.pdf");
    }
    ...

 


사이트 맵
©2000-2017 Solid Documents Limited - 모든 권한 및 저작권은 보호됩니다