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

Free Support Forum - aspose.com

Convert EPS to PNG using C# with Aspose.Page for .NET - Error: TypeCheck; Offending Command:

The following exception error occurs when attempting to convert

%%[Error: TypeCheck; Offending Command: //setglobal]%%

Operand Stack (bottom…top)
[ true true /ct_Clone? ]

Execution Stack (bottom…top)
[ --file (pipe) – --*packedarray (0…1, 1) – //setglobal //TypeCheck ]

Dictionary Stack (bottom…top)
[ --dictionary (350)-- --dictionary (1)-- --dictionary (8)-- --dictionary (57)-- --dictionary (9)-- ]

Based on the following sample code

    Dim license As Aspose.EPS.License = New Aspose.EPS.License()
    Dim P As String = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase)
    P = New Uri(P).LocalPath
    license.SetLicense(P & "\Aspose.EPS.lic")

    Dim psStream As FileStream = New FileStream(ofdEPS.FileName, FileMode.Open, FileAccess.Read)
    Dim suppressErrors As Boolean = True
    Dim options As Ps2ApsConverterOptions = New Ps2ApsConverterOptions(psStream, suppressErrors)
    options.PageSize = New System.Drawing.Size(595, 842)

    Dim Converter As Ps2ApsConverter = New Ps2ApsConverter()

        Dim imagesBytes As Byte()() = converter.ConvertToImages(options)
        Dim i As Integer = 0

        For Each imageBytes As Byte() In imagesBytes
            Using fs As FileStream = New FileStream(sfdPNG.FileName, FileMode.Create, FileAccess.Write)
                fs.Write(imageBytes, 0, imageBytes.Length)
            End Using

            i += 1

    End Try

    If suppressErrors Then

        For Each ex As PsConverterException In options.Exceptions
    End If


Thanks for contacting support.

Could you please share sample EPS file with us. We will test the scenario in our environment and address it accordingly.

486162.zip (1.0 MB)


Thank you for sharing requested data.

We have worked with the data shared by you and have been able to reproduce the issue in our environment. A ticket with ID EPSNET-124 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.