Convert .ai to .pdf not working

We are using aspose to convert AI to pdf, I got code example from here:

but the program just stuck at Image.load, the following line was not executed. can anyone help me slove this

@guguzzz could you please provide input file for the testing. Please note, at this moment Aspose.PSD can be used for the converting of old AI versions. New versions of AI files are the PDFs in common case, so you can just rename file from *.ai to *.pdf

@Dmitriy.Sorokin I renamed my ai file to .pdf, it worked, thank you! Is there a way for me to know if an ai file is old version?

@guguzzz try to open file with text editor. If there is header like:

%!PS-Adobe-3.0

it’s an old format.

If there is header like

%PDF-1.5

or any other version (1.3,1.4 etc), this is a new one.

Using library you can read the header with StreamReader to check this. We are working on support of all versions of AI, but it can take a time. ETA is the end of 2023.