I have the following code. It works, but the problem is if the image is too wide for the page, it is simply cut off. I need a way to tell the component to essentially ‘shrink to fit’ so the entire image can be visible.
Can this be done? If so, how? Code below.
Dim pdfGen As New Aspose.Pdf.Generator.Pdf()
Dim sec1 As Aspose.Pdf.Generator.Section = pdfGen.Sections.Add()
'Create an image object in the section
Dim image1 As Aspose.Pdf.Generator.Image = New Aspose.Pdf.Generator.Image(sec1)
'Add image object into the Paragraphs collection of the section
sec1.Paragraphs.Add(image1)
'Set the image file stream
image1.ImageInfo.ImageStream = inputStream
'Set the type of image using ImageFileType enumeration
image1.ImageInfo.ImageFileType = Aspose.Pdf.Generator.ImageFileType.Png
'Save the Pdf
pdfGen.Save(outputStream)