Produtos de Desktop :

Automação de Processos :

Desenvolvimento de Software:

 
Conversor de PDF para Word Clientes
 

Solid Framework - Amostra de Código

Este é um exemplo conciso para ajudar instalar e executar Solid Framework.Já foi testado com a Licença de Desenvolvedor Livre para Solid Framework utilizando diferentes versões do Visual Studio da Microsoft.

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

Clique para executar o Vídeo/Tutorial

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);
    }

 


Mapa do site
©2000-2017 Solid Documents Limited - Todos os direitos reservados.