PdfLoadedDocument save time

When loading a 59mb PDF using PdfLoadedDocument, adding a page number to each page and then saving it is taing over 2 minutes to to save the document. Is this normal?

Code is as follows:

        Dim loadedDocument As PdfLoadedDocument = New PdfLoadedDocument(DocPath)
        Dim paginationFont As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 8.0F)
        Dim brush As PdfBrush = PdfBrushes.Black
        Dim pageNumber As PdfPageNumberField = New PdfPageNumberField(paginationFont, brush)
        For i As Integer = 0 To loadedDocument.Pages.Count - 1
            pageNumber.Draw(loadedDocument.Pages(i).Graphics, New PointF(loadedDocument.Pages(i).Size.Width - 20, loadedDocument.Pages(i).Size.Height - 20))
            If PrefixPageNumberChar = 1 Then
                Dim page As PdfLoadedPage = TryCast(loadedDocument.Pages(i), PdfLoadedPage)
                Dim graphics As PdfGraphics = page.Graphics
                graphics.DrawString(PrefixCharacter, paginationFont, brush, New PointF(loadedDocument.Pages(i).Size.Width - 30, loadedDocument.Pages(i).Size.Height - 20))
            End If
        Next

        loadedDocument.Save()
        loadedDocument.Close(True)

1 Reply 1 reply marked as answer

SL Sowmiya Loganathan Syncfusion Team November 10, 2020 12:01 PM UTC

Hi Martin,   
 
Thank you for contacting Syncfusion support.   
 
We have analyzed the reported issue and tried to reproduce it with provided code snippet and PDF document with size 59 MB. We regret to let you know that we were unable to reproduce it and the whole process takes only 0.3 minutes only. So we suspect that the issue may related to document specific. Please share the below details, it will helpful for us to provide the precise solution on this.   
 
  • Input PDF document
  • Product version
 
Please let us know if you have any concerns on this.   
 
Regards,  
Sowmiya Loganathan 


Marked as answer
Loader.
Up arrow icon