Why this code does not work ?:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Aspose.Pdf;
using System.Threading;
namespace NewPDF
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
// Load PDF document
Thread myHilo = new Thread(new ThreadStart(crearEpud));
myHilo.Start();
myHilo.Join();
MessageBox.Show("documento creado");
}
private void crearEpud() {
string mdoc = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
Document pdfDocument = new Document(label1.Text);
// Instantiate EPUB Save options
EpubSaveOptions options = new EpubSaveOptions();
// Specify the layout for contents
options.ContentRecognitionMode = EpubSaveOptions.RecognitionMode.Flow;
// Save the EPUB document
pdfDocument.Save(@"C:/Users/ksi/Documents/Descargas/nuevodoc.epub", options);
}
private void button2_Click(object sender, EventArgs e)
{
openFileDialog1.Filter = "Archivos pdf(*.pdf)|*.pdf";
openFileDialog1.Title = "Archivos pdf";
if (openFileDialog1.ShowDialog() == DialogResult.OK) {
label1.Text = openFileDialog1.FileName;
}
openFileDialog1.Dispose();
}