public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdf_DocumentConversion(); // load PDF document Document pdfDocument = new Document(dataDir + "PDFToEPUB.pdf"); // instantiate Epub Save options EpubSaveOptions options = new EpubSaveOptions(); // specify the layout for contents options.ContentRecognitionMode = EpubSaveOptions.RecognitionMode.Flow; // save the ePUB document pdfDocument.Save(dataDir + "Sample.epub", options); }
public static void Main(string[] args) { // The path to the documents directory. string dataDir = Path.GetFullPath("../../../Data/"); // load PDF document Document pdfDocument = new Document(dataDir + "input.pdf"); // instantiate Epub Save options EpubSaveOptions options = new EpubSaveOptions(); // specify the layout for contents options.ContentRecognitionMode = EpubSaveOptions.RecognitionMode.Flow; // save the ePUB document pdfDocument.Save(dataDir + "Sample.epub", options); }
private void button2_Click(object sender, EventArgs e) { string path = this.textBox1.Text.Trim(); if (path != string.Empty) { label1.Visible = false; ThreadPool.QueueUserWorkItem((userState) => { // load PDF document Document pdfDocument = new Document(path); // instantiate Epub Save options EpubSaveOptions options = new EpubSaveOptions(); // specify the layout for contents options.ContentRecognitionMode = EpubSaveOptions.RecognitionMode.Flow; // save the ePUB document pdfDocument.Save(path + ".epub", options); if (label1.InvokeRequired) { this.Invoke(new Action(() => { label1.Visible = true; })); } else { label1.Visible = true; } }); } else { MessageBox.Show("Please choose a pdf file firstly."); } }