System.OutOfMemoryException

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();
}

Hi Nacho,


Thanks for contacting support.

It appears that OutOfMemory exception is occurring during PDF to EPUB conversion and the problem
might be related to input/source PDF file being used for conversion. Can you please share the resource files causing this problem, so that we can test the scenario in our environment. We are sorry for this inconvenience.
It works for small pdf.
Big pdf do crashear.

Hi Nacho,


Thanks for the acknowledgement.

Please share the resource PDF files for which you are facing the issue, so that we can again test the scenario in our environment.

This is de file.

Hi Nacho,


Thanks for using our API’s.

I have tested the scenario and have managed to reproduce same problem. For the sake of correction, I have logged it as PDFNEWNET-40641 in our issue tracking system. We will further look into the details of this problem and will keep you posted on the status of correction. Please be patient and spare us little time. We are sorry for this inconvenience.

The issues you have found earlier (filed as PDFNET-40641) have been fixed in Aspose.PDF for .NET 23.7.