Unable to save pdf as docx or to a stream

Unable to save a PDF to a docx or to a stream.
Version: 22.2.0
Tech Stack: .net

While attempting to save this file to docx or to a stream the save basically stops working. No exception is thrown and it does not ever finish saving the document.

Here is a copy of the pdf file we are attempting to save as docx or to a stream
8.4.b - ZMA-00179-2023_Moore Rezone RA to IL.staff report.pdf (3.5 MB)

Here is the code I’m using to convert to docx

private Document ConvertBadDocument(Document docToAdd)
        {
            if (!Directory.Exists(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "temp", @"convertingBadDocument")))
            {
                Directory.CreateDirectory(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "temp", @"convertingBadDocument"));
            }

            string tempPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "temp", @"convertingBadDocument\convertedDocument.docx");

            MemoryStream streamDocx = new MemoryStream();
            try
            {
                docToAdd.Save(tempPath, SaveFormat.DocX);
            }
            catch (Exception ex)
            {
                var test = "";
            }
            
            ELSLogHelper.InsertInfoLog(ELSLogHelper.AsposeLogMessage("Save"), MethodBase.GetCurrentMethod()?.Name, MethodBase.GetCurrentMethod().DeclaringType?.Name, Environment.StackTrace);

            var docx = new wordsAspose.Document(tempPath);
            ELSLogHelper.InsertInfoLog(ELSLogHelper.AsposeLogMessage("Open"), MethodBase.GetCurrentMethod()?.Name, MethodBase.GetCurrentMethod().DeclaringType?.Name, Environment.StackTrace);

            MemoryStream streamPdf = new MemoryStream();
            docx.Save(streamPdf, wordsAspose.SaveFormat.Pdf);
            ELSLogHelper.InsertInfoLog(ELSLogHelper.AsposeLogMessage("Save"), MethodBase.GetCurrentMethod()?.Name, MethodBase.GetCurrentMethod().DeclaringType?.Name, Environment.StackTrace);

            streamDocx.Close();

            docToAdd = new Document(streamPdf);
            ELSLogHelper.InsertInfoLog(ELSLogHelper.AsposeLogMessage("Open"), MethodBase.GetCurrentMethod()?.Name, MethodBase.GetCurrentMethod().DeclaringType?.Name, Environment.StackTrace);

            if (File.Exists(tempPath))
            {
                File.Delete(tempPath);
            }

            return docToAdd;
        }

Here is the code we used when converting it to a stream

private Document ConvertBadDocument(Document docToAdd)
        {
            MemoryStream streamDocx = new MemoryStream();
            docToAdd.Save(streamDocx, SaveFormat.DocX);
            ELSLogHelper.InsertInfoLog(_callContext, ELSLogHelper.AsposeLogMessage("Save"), MethodBase.GetCurrentMethod()?.Name, MethodBase.GetCurrentMethod().DeclaringType?.Name, Environment.StackTrace);
            var docx = new wordsAspose.Document(streamDocx);
            ELSLogHelper.InsertInfoLog(_callContext, ELSLogHelper.AsposeLogMessage("Open"), MethodBase.GetCurrentMethod()?.Name, MethodBase.GetCurrentMethod().DeclaringType?.Name, Environment.StackTrace);
            MemoryStream streamPdf = new MemoryStream();
            docx.Save(streamPdf, wordsAspose.SaveFormat.Pdf);
            ELSLogHelper.InsertInfoLog(_callContext, ELSLogHelper.AsposeLogMessage("Save"), MethodBase.GetCurrentMethod()?.Name, MethodBase.GetCurrentMethod().DeclaringType?.Name, Environment.StackTrace);
            streamDocx.Close();
            docToAdd = new Document(streamPdf);
            ELSLogHelper.InsertInfoLog(_callContext, ELSLogHelper.AsposeLogMessage("Open"), MethodBase.GetCurrentMethod()?.Name, MethodBase.GetCurrentMethod().DeclaringType?.Name, Environment.StackTrace);
            return docToAdd;
        }

@ST2YKE2

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-56176

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@asad.ali

I hope these can be added to the internal ticket.

I am also getting additional issues with some more files. I’m getting an out of memory exception even though the server is at 50% memory usage.

image.png (100.0 KB)

Here is the file giving an out of memory exception
Attachment D Site plan and elevations.pdf (6.0 MB)

@ST2YKE2

While testing the case with 23.11 version of the API, we did not notice any exception with this document. Can you please try to use the latest version and let us know in case issue still persists.

@asad.ali

One thing to note with these files is that I cannot get them to convert using your public conversion site.

@ST2YKE2

About the second file that you shared, we could not reproduce the exception in our environment using the latest version of the API. If you are facing some error in using online apps, you can please report it in the dedicated respective support forum. You will be assisted there accordingly.