ASPOSE PDF Generator class

Hi,

We were using previous version of ASPOSE.Total now want to shift to latest version so doing code modifications for Generator class. Below is our current code for various image type files. How this can be written in new version?

private static Aspose.Pdf.Generator.ImageFileType GetImageFileTypes(string format)
{
try
{

         switch (format)
         {
                case "JPG":
                return Aspose.Pdf.Generator.ImageFileType.Jpeg;

                case "PNG":
                return Aspose.Pdf.Generator.ImageFileType.Png;

                case "BMP":
                return Aspose.Pdf.Generator.ImageFileType.Bmp;

                case "GIF":
                return Aspose.Pdf.Generator.ImageFileType.Gif;
        }            
        
        throw new Exception("Image format not supported");
      }
        catch (Exception )
        {
            throw;
        }
  }

Thanks,
Sanjay

@sanjayadsure,

Please try using Aspose.Pdf.Image object of new Document Object Model for the conversion of Image files to PDF format. Please note that in this new approach, you do not need to specify the image file type because the API will automatically determine its type. For further details, please visit How to convert Image file to PDF format.

In case you encounter any issue, please share the input image files.