Free Support Forum - aspose.com

PDF document takes too long to convert

We use Aspose.Pdf 19.4.0.
There is a large PDF document about 600 MB in size. We need to convert some pages of this document to images. To do this, we used the following code:

Summary
var resultConvert = new ConvertResult { FolderPath = UniqTempFolderName, IsImage = true };
      try
      {
        using (new Foundation.Security.Deimpersonation())
        {
          using (var document = new Document(settings.InputFilePath))
          {
            resultConvert.PageCount = document.Pages.Count;

            using (var imageStream = new FileStream(settings.ResultFilePath, FileMode.Create))
            {
              var resolution = new Resolution(_convertResolution);
              var imageDevice = new PngDevice(resolution);
              var page = document.Pages[settings.PageNumber];

              var swConvertation = new Stopwatch();
              swConvertation.Start();

              imageDevice.Process(page, imageStream);

              swConvertation.Stop();
              Log.LogInfo($">> Convertation pdf to image ended. time: {swConvertation.Elapsed.TotalMilliseconds}ms");

              imageStream.Close();

              resultConvert.ResultFiles[settings.PageNumber] = settings.ResultFileName;
            }
          }
        }
      }

As a result, the pages take quite a long time to convert (11.5 seconds). There is an entry in the log file:
24.04.2020 17:28:49 Information >> Convertation pdf to image ended. time: 11455,1858ms

How can I make the pages convert faster?

@directum

Would you kindly share the Page Number(s) which are taking long time to convert into PNG. We will test the scenario in our environment and address it accordingly.

Document conversion time does not depend on the specific pages we try to convert. It takes a while no matter which pages are converted. We tested on pages 300, 301 and so on.

@directum

We were able to notice that API was taking long time to convert PDF Pages into PNG images. We have logged an issue as PDFNET-48118 in our issue tracking system related to the performance of the API. We will further look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.

Could you please tell me when this issue is going to be fixed?

@directum

We would like to share with you that the issue has been logged under normal support model and it has low priority. It will be resolved on first come first serve basis. We will surely inform you as soon as it is resolved. Please spare us some time.

We are sorry for the inconvenience.