I’m upgrading one of our applications from v11.1 to v17.4 of Aspose.Pdf. We have several methods which use Generator (e.g., Pdf, Section, Image). Can you point me to some documentation that would help me convert a method like the one below, given “Generator” has been removed between versions 11.1 and 17.4?
Hi There,
Hi, does the ‘convert an image to pdf’ link above produce a pdf that just contains an image, or does it produce a pdf with selectable text, but that looks exactly like the scanned image (including any images the scanned image might contain)?
Thanks for contacting support.
The inquired article is about adding an image inside PDF as content. The image added by this process, can only be retrieved as an image from PDF document. However, please share if you have some different requirements, so that we can share relevant information with you.
Hi,
with the same line of code along with Generator(img to pdf) , I get a parameter not valid error while i do pdfFilePdf.Save(pdfFile);
any suggestions
Could you please share your sample PDF document with us. We will test the scenario in our environment and address it accordingly.
@asad.ali
hi , here is the code as PDF is never generated , i get an exception of Parameter is not valid while the save the doc
private byte[] ConvertImageToPdf(byte[] imageFile)
{
var pdfFile = new MemoryStream();
Aspose.Pdf.Generator.Pdf pdfFilePdf = new Aspose.Pdf.Generator.Pdf();
Aspose.Pdf.Generator.Section pdfSection = pdfFilePdf.Sections.Add();
Aspose.Pdf.Generator.Image objImage = new
Aspose.Pdf.Generator.Image(pdfSection);
pdfSection.Paragraphs.Add(objImage);
objImage.ImageInfo.ImageStream = new MemoryStream(imageFile);
pdfFilePdf.Save(pdfFile);
return pdfFile.ToArray();
}
Thank you for contacting support.
We have addressed some concerns in another post created by you. Kindly follow up in respective thread.