'HiQPDF error "Cannot write the document to output file. Invalid Serial Number Version." when merging 2 pdf
I'm using HiQPdf to merge 2 pdf in one file, following to the official help: https://www.hiqpdf.com/documentation/html/e5d2f1ee-dccb-4351-888e-e3f3c15a93a5.htm I get the "HiQPdf Evaluation". Which prove the code works. I added my serial number:
PdfDocument resultDocument = new PdfDocument();
resultDocument.SerialNumber = "AU***************-OA=="; // this line is not in the help
PdfDocument document1 = PdfDocument.FromFile("c:\\temp\\doc1.pdf);
resultDocument.AddDocument(document1);
PdfDocument document2 = PdfDocument.FromFile("c:\\temp\\doc2.pdf);
resultDocument.AddDocument(document2);
resultDocument.WriteToFile("c:\\temp\\MergePdf.pdf"); //getting an Exception here !
I get an exception on the resultDocument.WriteToFile : Cannot write the document to output file. Invalid Serial Number Version. If I remove the resultDocument.SerialNumber, the merged pdf is generated but with the "HiQPdf Evaluation" water mark.
I assert that my serial is correct since I succesfully use it to for HtmlToPdf conversion:
HtmlToPdf htmlToPdfConverter = new HtmlToPdf();
htmlToPdfConverter.SerialNumber = "AU***************-OA==";
PdfDocument resultDoc = null;
resultDoc = htmlToPdfConverter.ConvertHtmlToPdfDocument(html, "");
This code (with my serial) succesfully produces a PDF without the "HiQPdf Evaluation: water mark. And if I remove my serial, the "HiQPdf Evaluation: water mark appears.
Is there another place/way to use the serial? Is it possible that my Serial is correct for htmlToPdfConverter but not the PdfDocument merging?
Solution 1:[1]
I finally received a response from the support: my serial is valid for a PREVIOUS version of HiQPdf.
Be aware that in Nuget, the only version available is version 12. To downgrade you need to find a backup of your previous version of HiQPdf.dll and put it manually in you packages.
Below the response from the support:
HiQPdf Sales [email protected] Mon 18/04/2022 18:20
Hello,
Your serial number is for version 10 of the software. For version 12 you need a new serial number.
You can renew the old license with a 20% renewal discount to obtain a serial number for the latest version of the software in the page below: [link removed]
Best Regards,
Jacob
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Emmanuel Gleizer |