Example #1
0
 private void Preview_Load(object sender, EventArgs e)
 {
     Spire.Pdf.PdfDocument pdfdocument = new Spire.Pdf.PdfDocument();
     if (File.Exists(_Analis.filename))
     {
         //   pdfDocumentViewer1.LoadFromFile(_Analis.filename);
     }
     pdfdocument.PrintDocument.Print();
     pdfdocument.Dispose();
 }
Example #2
0
        private void PdfToWord_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFile = new OpenFileDialog();

            openFile.Filter = "Text Documents (.pdf)|*.pdf|All files (*.*) | *.*";
            var result = openFile.ShowDialog();

            if (result == true)
            {
                var path     = openFile.FileName;
                var fileName = openFile.SafeFileName;
                Spire.Pdf.PdfDocument pdfDoc = new Spire.Pdf.PdfDocument();
                pdfDoc.LoadFromFile(path);

                pdfDoc.ConvertOptions.SetPdfToDocOptions();
                pdfDoc.SaveToFile(System.IO.Path.Combine(BasePath, $"{fileName}.doc"), Spire.Pdf.FileFormat.DOC);
                pdfDoc.Close();
                pdfDoc.Dispose();
            }
        }