デスクトップ製品:

プロセスの自動化:

ソフトウェア開発:

 
PDF から Word に変換 お客様
 

Solid Framework コード サンプル

Solid Framework の使用方法を示す簡単なサンプルです。 このサンプルは、Solid Framework の開発者用ライセンス (無料) を使用して Microsoft Visual Studio の異なるバージョンでテストされています。

PDF Transformers

Convert PDF Files to Searchable PDF files by adding a Text Layer while preserving the files original Image Compression using our OCRTransformers.

PDF Transformers

紹介ビデオを再生するにはここをクリックしてください。

Steps for Transforming PDF Files

  1. Import the trial Developer License:


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

  2. Locate the PDF files using OpenFileDialog:


    //Create an OpenFileDialog that allows the user to select a PDF File
    OpenFileDialog OpFile = new OpenFileDialog();

    //Show only PDF files
    OpFile.Filter = "PDF files (*.pdf)|*.pdf";

    //Manage what happens if someone clicks on Cancel
    if (OpFile.ShowDialog() != System.Windows.Forms.DialogResult.OK)
    {
    ...

  3. Define strings to manage the user selected file and the saving of the new file.:


    //Define Two Strings to capture the selection and saving of your file
     string pdfPath = OpFile.FileName;
     string searchablePdfPath = Path.ChangeExtension(pdfPath, "searchable.pdf");

  4. Create a new PDFDocument Object:


        //Create a new PdfDocument Object called document and assign the selected PDF file to it
        using (PdfDocument document = new PdfDocument(pdfPath))
       {

  5. Use OCRTransformer to add a searchable text layer to your new files:


       //Create a new OCRTransformer Object
         OcrTransformer transformer = new OcrTransformer();

        //Set the OcrType to Create a Searchable TextLayer
        transformer.OcrType = OcrType.CreateSearchableTextLayer;

         //Set the OCR Language to the Language in your PDF File - "en" for English, "es" for Spanish etc.
         transformer.OcrLanguage = "en";

         //Preserve the Original PDF Files Image Compression
         transformer.OcrImageCompression = SolidFramework.Imaging.Plumbing.ImageCompression.PreserveOriginal;

          //Add the user selected PDF file to your transformer
          transformer.AddDocument(document);

  6. Apply your transform settings to the files:


    //Transform the PDF File
    transformer.Transform();

  7. Save your new file with the name you specified earlier:


    //Save the new Searchable PDF file to the extension you specified earlier
     document.SaveAs(searchablePdfPath, OverwriteMode.ForceOverwrite);
    }

 


サイトマップ
©2000-2017 Solid Documents Limited - All Rights Reserved.