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

Free Support Forum - aspose.com

An entry with the same key already exists


Im running some tests trying to figure out which color depth / compression i want to use when converting a pdf to tiff and checking the size in bytes afterwards… however, when i use the TiffDevice.Process method, i get an Argument Exception Occurred: An entry with the same key already exists. If i step further, i get Exception thrown: ’ . ’ in Aspose.Pdf.dll
Additional information: Glyph with ID = 3242 already exists in Coverage list

This is happening with all pdf files ive tried.

Below it my code:

Private Sub Test1(ByRef TestResults As List(Of TestResult))

For Each cd As ColorDepth In ColorDepths
For Each cmp As CompressionType In CompressionTypes

'Create new test
Dim result As New TestResult()
result.Utility = “Aspose”
result.Compression = cmp.ToString()
result.Format = cd.ToString()
result.View = New WorkspaceViewer

'Open document
Dim pdfDocument As New Document(FileName)

Dim resolution As New Resolution(300)

'Create TiffSettings object
Dim tiffSettings As New TiffSettings()
tiffSettings.Compression = CompressionType.None
tiffSettings.Depth = ColorDepth.Default
tiffSettings.Shape = ShapeType.Portait
tiffSettings.SkipBlankPages = False

'Create TIFF device
Dim tiffDevice As New TiffDevice(resolution, tiffSettings)

Dim ms As New MemoryStream

'Convert a particular page and save the image to stream
tiffDevice.Process(pdfDocument, ms)

result.Size = Math.Round(ms.Length / 1000, 0)


tiffDevice = Nothing
tiffSettings = Nothing


End Sub

Hi Chris,

Thank you your inquiry.

Please, forward us your sample project along with the sample PDF files so that we can reproduce the issue at our end. Your sample project along with sample PDF will help us to look deep into it and find the root cause of the issue.

Waiting for you reply along with sample project & PDFs.