PDDocSave takes more time in saving the files

186 Views Asked by At

I found slowness in Inserting and saving the PDF files with the latest libraries (APDFL15.0.4PlusP4a and APDFL15.0.4PlusP2e). The slowness happens when the page count is more than 300.

The below code saves a 450 pages document using PDDocSave by inserting a temporary(accumulated) document with 40 pages each.

When replaced with an older version ( APDFL15.0.1PlusP1h) the performance was better.

  // Assemble accumulated files
  for(int j=1;j<=accumCount;j++)
  {
     sprintf(accumName,ACCUM_FILETEMPLATE, j);
     TSTBUG1(1,"Opening accumulator :%s",accumName);
     pdDoc2 = MyPDDocOpen(accumName);
     if (!pdDoc2)
     {
        SYS_ERR "Unable to open file %s \n",accumName);
        return PDFASSEMBLY_FAILURE;
     }
     PDDocInsertPages (pdDoc1,PDLastPage,pdDoc2, 0, PDAllPages,PDInsertAll, NULL,NULL,NULL,NULL);
     TSTBUG1(1,"Inserting accumulator : %d\n",j);
     PDDocRelease(pdDoc2);
     PDDocClose(pdDoc2);
     unlink (accumName);
  }
  TSTBUG1(20,"Saving file =>%s<=",ptrMasterPDFDocumentList->ptrHeader->strOutputPDFFile);
  PDDocSave(pdDoc1,PDSaveFull|PDSaveLinearized,
           ASPathFromPlatformPath(ptrMasterPDFDocumentList->ptrHeader->strOutputPDFFile),
           ASGetDefaultFileSys(),NULL,NULL);
0

There are 0 best solutions below