Hi, I’m using GroupDocs.Merger and I’m getting this error: GroupDocsMergerException: Failed to detect file type.
My C# code looks like this…
var tocStream = new MemoryStream(); // tocStream contains an ASCII encoded byte array of HTML using (Merger merger = new Merger(tocStream)) // error on this line... { merger.Join(filePath) ...add more documents to the Merger object }
This used to work in an older version of GroupDocs.Merger that I used on .NET5.
I have recently upgraded our codebase to .NET6 and updated our GroupDocs.Merger to Version 22.1 and now we get this error.
Can you give me any advice on what I need to do to make this work properly again?
Could not load file or assembly ‘Aspose.PDF, Version=20.6.0.0, Culture=neutral, PublicKeyToken=f0262d67fe233d63’. General Exception (0x80131500)
I decided to try to download Aspose.PDF from Nuget. Now my code runs without error, but it only renders three pages in the PDF output (when I expected dozens of pages.)
No, I do not get the evaluation watermark in the output document.
I don’t have a license for Aspose.PDF. I purchased GroupDocs.Merger and it appears to be asking for Aspose.PDF. I only downloaded Aspose.PDF because GroupDocs.Merger seems to be asking about it (and I am desparate to get this working.)
I could not get the Merger() constructor to work with a stream, so I switched to a file.
using (Merger merger = new Merger(filename) { ...merge additional files in a loop... merger.Save(mergedFileName); }
But I’ve noticed that the handle to the file that I pass to the constructor is not closed after exiting the using() context. This causes an error the next time I try to merge that file into another PDF.