Desktop Products:

Process Automation:

Software Development:

PDF-naar-Word-converter Klanten

Solid Framework Code Sample

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

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

Click to play Code Walk Through Video

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

  6. Apply your transform settings to the files:

    //Transform the PDF File

  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-2018 Solid Documents Limited - Alle rechten voorbehouden