桌面产品:

加工自动化:

软件开发:

 
PDF to Word 转换器 客户
 

Solid Framework Code Sample

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

Using OCR for Searching

The code below shows you how to convert PDF files to a searchable PDF/A-2b file

Using OCR for Searching

点击播放“密码演示视频”

Steps for Creating a Searchable PDF/A-2b

  1. Import the trial Developer License:


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

  2. Locate the PDF files using OpenFileDialog:


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

    if (OpFile.ShowDialog() == System.Windows.Forms.DialogResult.OK)
    {
    ...

  3. Define 2 strings to manage file selection and saving:


    ...
    string ocrPath = OpFile.FileName;
    string strPDFPath = Path.ChangeExtension(ocrPath, "pdfa.pdf")

  4. Create a Solid Framework PdftoPdfaConverter object called converter:


    using (PdfToPdfAConverter converter = new PdfToPdfAConverter())
    {
    ...

  5. Make the file searchable and convert:


      //Make the Converted File Searchable
      converter.OcrType = SolidFramework.Converters.Plumbing.OcrType.CreateSearchableTextLayer;

      //Set the PDF/A Validation
      converter.ValidationMode = SolidFramework.Plumbing.ValidationMode.PdfA2B;

      //Then add the Source File
      converter.AddSourceFile(ocrPath);
     
      //Convert the file, setting overwrite to true
      converter.ConvertTo(strPDFPath, true);
    }
    ...

 


网站导航
©2000-2017 Solid Documents Limited - 版权所有