'The document appears to be corrupted and cannot be loaded

hi
i am just loading a document as given in documentation but getting this exception :
’The document appears to be corrupted and cannot be loaded.

I have tried different pdf documents but getting this same exception. I am using following code :

Aspose.Words.Document pdfDocument = new Aspose.Words.Document("C:\\Users\\usman.arshad\\Downloads\\rst.pdf"); 

Html documents are loading but pdfs are not. Attaching a pdf documents as well

thanks

rst.pdf (243.0 KB)

@Usman.19 I cannot reproduce the problem using the latest 23.5 version of Aspose.Words for .NET. Please try using the latest version and let us know if the problem still occurs on your side.

@alexey.noskov thanks for the response
i am providing you another html Document and complete code as well that is also causing the issue. please let me know if its producing on your side.

thanks

htmlDoc.zip (102.9 KB)

var license = new License();
license.SetLicense("Aspose.Words.lic");

var htmlLoadOptions = new HtmlLoadOptions();
htmlLoadOptions.PreferredControlType = HtmlControlType.StructuredDocumentTag;

// Setting the Enconding
htmlLoadOptions.Encoding = Encoding.UTF8;

// Create a new class implementing IWarningCallback which collect any warnings produced during document save.
var callback = new HandleDocumentWarnings();

// We assign the callback to the appropriate save options class. In this case, we are going to save to Word
// so we create a HtmlLoadOptions class and assign the callback there.
htmlLoadOptions.WarningCallback = callback;

// Load the Html document into memory
htmlLoadOptions.BlockImportMode = BlockImportMode.Preserve;
var document = new Document("C:\\Users\\usman.arshad\\Downloads\\charlottesweb-sx3.htm", htmlLoadOptions);

@Usman.19
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): WORDSNET-25528

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.

The problem is caused by BlockImportMode.Preserve. So as a temporary workaround you can use BlockImportMode.Merge.

@alexey.noskov thanks a lot for your response
can we get a rough estimate about when the issue can be fixed ?

@Usman.19 Unfortunately, at the moment there is no estimate for this issue. It is currently in the queue for analysis. Once analysis is done we will be able to provide you more information.

The issues you have found earlier (filed as WORDSNET-25528) have been fixed in this Aspose.Words for .NET 23.9 update also available on NuGet.