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

Free Support Forum - aspose.com

Image is blurred after inserting into table

Hello,
I noticed that after inserting .png image into table the quality is lost, it is blurred and round parts are straightened.

Demo project that shows the problem:
https://drive.google.com/file/d/0B-CEaN01bFt3MHduWUdnSktTM1E/view?usp=sharing

Code which is used to insert image into table:


Private Function CreateImageCell(ByVal parentRow As Aspose.Pdf.Row,
                                     ByVal image As System.Drawing.Image,
                                     Optional ByVal imageResolution As Integer = -1) _
                                        As Aspose.Pdf.Cell
        Dim Cell As Aspose.Pdf.Cell
        Cell = parentRow.Cells.Add("")
        Cell.Alignment = Aspose.Pdf.HorizontalAlignment.Left
        Cell.VerticalAlignment = Aspose.Pdf.VerticalAlignment.Center

        Cell.ColSpan = 1

        AddImageToCell(Cell, image, imageResolution)

        Return Cell
    End Function

    Private Sub AddImageToCell(ByVal cell As Aspose.Pdf.Cell,
                               ByVal image As System.Drawing.Image,
                               Optional ByVal imageResolution As Integer = -1)
        If image IsNot Nothing Then
            Dim ImageStream As IO.MemoryStream = GetImageStream(image)

            Dim AsposeImage As New Aspose.Pdf.Image()
            AsposeImage.ImageStream = ImageStream
            AsposeImage.FileType = Aspose.Pdf.ImageFileType.Unknown

            If imageResolution > 0 Then
                AsposeImage.FixHeight = imageResolution
                AsposeImage.FixWidth = imageResolution
            Else
                AsposeImage.FixHeight = image.Height
                AsposeImage.FixWidth = image.Width
            End If

            cell.Paragraphs.Add(AsposeImage)
        End If
    End Sub

@tak

Thanks for contacting support.

We have tested the scenario by running your project with Aspose.Pdf for .NET 17.10 and observed that the images were blurred in the generated PDF document. However, we have logged an issue as PDFNET-43621 in our issue tracking system. We will further investigate the issue and keep you posted with the status of its correction. Please be patient and spare us little time.

We are sorry for the inconvenience.