Welcome Guest Search | Active Topics | Sign In | Register

Issue merging PDFs Options
Zubair
Posted: Wednesday, August 23, 2023 3:32:59 PM
Rank: Newbie
Groups: Member

Joined: 8/23/2023
Posts: 1
Code: C#
Hi All,

We are having issues when merging PDF , it is throwing this exception even the PDF is correct.
We are using version 5.0.57, please advice.

“Message: Unknown error encountered on server. Message:'Property 'Pages' can not be empty.' when merging pdfs.”

protected byte[] MergePdfs(byte[] masterPdf, IEnumerable<ClientFile> additionalPdfs)
{
try
{
Runtime.AddLicense(ConfigurationManager.AppSettings["EOPDFLicense"]);
PdfDocument basePDF;
using (var basePDFStream = new MemoryStream(masterPdf))
{
basePDF = new PdfDocument(basePDFStream);
}
foreach (var pdf in additionalPdfs)
{
using (var tempStream = new MemoryStream(pdf.FileBytes))
{
var pdfToAppend = new PdfDocument(tempStream);
basePDF = PdfDocument.Merge(basePDF, pdfToAppend);
}
}
using (var stream = new MemoryStream())
{
basePDF.Save(stream);
masterPdf = stream.ToArray();
}
return masterPdf;
}
catch (Exception e)
{
IntelliCorpLogger.Write("RegistrationToolsController.MergePdfs",
String.Format("Unknown error encountered on server. Message:'{0}' when merging pdfs.", e.Message),
new List<string> { "Exception" });
return null;
}
}


Thanks
eo_support
Posted: Wednesday, August 23, 2023 3:45:52 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,088
Hi,

Please see if the latest build still have the same problem. If the problem still occurs with the latest build, please try to isolate the problem into a small test project and then send the test project to us. See here for more details:

https://www.essentialobjects.com/forum/test_project.aspx

We will look into it as soon as we receive the test project.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.