Converting TIF to PDF v17.x to 19.x issue

Good day

I recently upgraded to the latest PDF v.19.x from my existing v.17.x and have noted a huge delay when converting from TIF to PDF. The same code is used between both versions, however when using v.19.x it can take 5 min to add three pages and 1 second when using v.17.x?? It seems to hang on “doc.Save(dstFile)”

        ' Instantiate Document Object
    Dim doc As Aspose.Pdf.Document = New Aspose.Pdf.Document()
    Dim mystream As IO.MemoryStream

    For Each f As String In fileNames
        Dim page As Aspose.Pdf.Page = doc.Pages.Add()
        ' Load the source image file to Stream object

        Using fs As New IO.FileStream(f, IO.FileMode.Open, IO.FileAccess.Read)
            Dim tmpBytes(fs.Length) As Byte
            fs.Read(tmpBytes, 0, Convert.ToInt32(fs.Length))

            mystream = New IO.MemoryStream(tmpBytes)
            ' Instantiate BitMap object with loaded image stream
            Using b As Bitmap = New Bitmap(mystream)
                ' Set margins so image will fit, etc.
                page.PageInfo.Margin.Bottom = 0
                page.PageInfo.Margin.Top = 0
                page.PageInfo.Margin.Left = 0
                page.PageInfo.Margin.Right = 0

                'page.CropBox = New Aspose.Pdf.Rectangle(0, 0, b.Width, b.Height)
                page.SetPageSize(b.Width, b.Height)
                ' Create an image object
                Dim image1 As Aspose.Pdf.Image = New Aspose.Pdf.Image()
                If IO.Path.GetExtension(f).ToLower = ".tif" Then
                    image1.IsBlackWhite = True
                End If
                ' Add the image into paragraphs collection of the section
                page.Paragraphs.Add(image1)
                ' Set the image file stream
                image1.ImageStream = mystream

            End Using

        End Using

    Next
    dstFile = dstFile.Replace("\\", "\")
    doc.Save(dstFile)

    ' Close memoryStream object
    mystream.Dispose()

@WayneH

Thank you for contacting support.

Would you please share source and generated files along with system specifications so that we may investigate further.

Hi Farhan

Please see below zip containing 3 tiff files. I pass these to the above function, using v17.x it works 100%, however using 19.x it takes forever to save.

Is that all you need?

00000001.zip (54.8 KB)

@WayneH

We have been able to reproduce the issue in our environment. A ticket with ID PDFNET-47347 has been logged in our issue management system for further investigation and resolution. The ticket ID has been linked with this thread so that you will receive notification as soon as the ticket is resolved.

We are sorry for the inconvenience.