As per your saying that ‘we do not provide support for older releases of Aspose APIs’.
Now we are updating old Aspose.Pdf with latest 19.9 dll but unable to convert code.
Can you please help me to convert the below code:
public byte[] ConvertImageToPdf(byte[] doc)
{
//Instantiate a Pdf object
MemoryStream ms = new MemoryStream(doc);
MemoryStream msPng = new MemoryStream();
MemoryStream convPdf = new MemoryStream();
Pdf pdf1 = new Pdf();
// Create a new section in the Pdf document
Aspose.Pdf.Generator.Section sec1 = new Aspose.Pdf.Generator.Section(pdf1);
//Add the section in the sections collection of the Pdf document
pdf1.Sections.Add(sec1);
//Create an image object
Aspose.Pdf.Generator.Image image1 = new Aspose.Pdf.Generator.Image(sec1);
//Add the image into paragraphs collection of the section
sec1.Paragraphs.Add(image1);
image1.ImageInfo.ImageFileType = Aspose.Pdf.Generator.ImageFileType.Png;
//Set the ImageStream to a MemoryStream object
image1.ImageInfo.ImageStream = msPng;
//Set desired the image scale
image1.ImageScale = 0.5F;
pdf1.Save(convPdf);
return convPdf.GetBuffer();
}