This is a concise sample to help get Solid Framework up and running. It has been tested with the Free Developer License for Solid Framework using different versions of Microsoft's Visual Studio.
The code below shows you how to combine multiple PDF files, using the OpenFileDialog function to find your PDF file and then the PagesModel to combine your multiple files to a single PDF file.
- Import the trial Developer License:
License.Import(new StreamReader(@"C:\Users\Joe\license.xml"));
- Locate the PDF files to using OpenFileDialog:
OpenFileDialog OpFile = new OpenFileDialog();
//show only PDF Files
OpFile.Filter = "PDF Files (*.pdf)|*.pdf";
if (OpFile.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
...
- Define strings to manage opening and saving files:
String pdfPath = OpFile.FileName;
String wordPath = Path.ChangeExtension(pdfPath, ".docx");
- 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;
//Convert the file renaming it with the word extension and setting overwrite to true
converter.ConvertTo(wordPath, true);
}
...