We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.PDF Not able to merge more than 4 documents

Hi,

As discussed earlier, we are trying to replace Debenu Quick PDF with Aspose.PDF library. We are evaluating the trial version of Aspose.PDF for merging multiple documents. But We are getting the below error when we try to merge more than 4 documents.

“At most 4 elements (for any collection) can be viewed in evaluation mode.”

We are not able to test many of our test cases due to this limitation. As a part of our QA process we need to test merging of more than 200 pdfs. So, we are not able test Aspose.PDF properly. We really need to merge large number of pdf documents and test it properly without which we can’t evaluate the Aspose.PDF library.

We are okay with getting the “watermark” on all the pdf documents that we merge as a part of evaluation limitation. Hope you can understand our situation.

Please provide us with a temporary trial key which we can utilize temporarily until this Aspose.PDF upgrade passes our QA.

I have added a sample code where we get this error for your reference.

public bool MergePDFFiles(List filesList, string mainPDFOutputFileName, bool openFile)
{
int index = 0;
bool success = false;
try
{
// Create main outputfile
using (Document mainPDF = new Document())
{
mainPDF.Save(mainPDFOutputFileName, SaveFormat.Pdf);
if (mainPDF != null)
{
foreach (string pdfFile in filesList)
{
if (File.Exists(pdfFile))
{
using (Document pdf = new Document(pdfFile))
{
// Add pages of all other pdf documents to the mainPDF document.
mainPDF.Pages.Add(pdf.Pages);//#ToCheck: add/insert

                                    ////Below approach was used for Aspose.Slides, may not be required for Aspose.PDF, remove later //#RemoveAfterCompleteTesting
                                    //foreach (Aspose.Pdf.Page eachPage in pdf.Pages)
                                    //{
                                    //    // VVIMP: Use Insert always, instead of Add to merge the files, as it was causing the image display quality issues.
                                    //    mainPDF.Pages.Insert(index, eachPage);///#ToCheck: /mainPDF.Pages.Insert(index + 1, eachPage);
                                    //    index++;
                                    //}
                                }
                            }
                        }

                        mainPDF.Save(mainPDFOutputFileName, SaveFormat.Pdf);
                    }
                }

                if (openFile)
                    GlobalFunction.OpenFile(mainPDFOutputFileName);

                success = true;
            }
            catch (Exception ex)
            {
                ExceptionLog.LogException(ex, "Failed to merge PDF files");
                throw ex;
            }

            return success;
        }

Thanks,
Prathap

Hi Prathap,

 It is possible to get a **temporary license** (https://purchase.aspose.com/temporary-license) with full access. You can do that by adding products to your cart in the **purchase wizard** (https://purchase.aspose.com/buy) or you can request it from an **existing quote** (https://purchase.aspose.com/orders). 

I hope that it helps.

@PrathapSV,

To avoid this issue, please get 30 days temporary license and apply it before importing PDF file into Aspose.PDF DOM.

Please read the following article about applying the license.
How to Apply the License