Asztali termékek:

Folyamat automatizálás:

Szoftverfejlesztés:

 
PDF-ből Word-be konvertáló Vevők
 

Solid Framework kódolási minta

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

Convert PDF Files to Word

The code below shows you how to convert a PDF file to a Word document, using the OpenFileDialog function to find your PDF file and then the PDFtoWordConverter to convert to Microsoft Word.

Convert PDF Files to Word

Kattintson ide a lépéseket bemutató videó lejátszásához

Steps for Converting PDF to Word

  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 strings to manage opening and saving files:


    String pdfPath = OpFile.FileName;
    String wordPath = Path.ChangeExtension(pdfPath, ".docx");

  4. Convert the PDF File using PDFtoWordConverter:


    ...
    using (PdfToWordConverter converter = new PdfToWordConverter())
    {
      //Add the selected file
      converter.AddSourceFile(pdfPath);
                   
      //Continuous mode recovers text formatting, graphics and text flow
      converter.ReconstructionMode = ReconstructionMode.Continuous;
      
      //Or Use Flowing Reconstruction Mode if you need to keep the look and feel of the PDF
      converter.ReconstructionMode = ReconstructionMode.Flowing;

    // To catch conversion result and display it to the user use the following
    ConversionStatus result = converter.ConvertTo(wordPath, true);
    SolidFramework.Forms.SolidMessageBox addDialog = new SolidFramework.Forms.SolidMessageBox(this);
    addDialog.Content = result.ToString();
    addDialog.Text = "Conversion Result";
    addDialog.ShowIcon = true;
    addDialog.MessageIcon = MessageBoxIcon.Information;
    addDialog.Execute();

    //To just convert the file with no message use only
    converter.ConvertTo(wordPath, true);
    }
    ...

 


Oldaltérkép
©2000-2017 Solid Documents Limited - Minden jog fenntartva