Hello,
https://docs.aspose.com/pdf/net/working-with-images/
Hello,
Hi Neil,
Well this is the issue I don’t know where to start so I don’t really have any code.
Hi Neil,
Thanks for sharing the code snippet.
I have tested the scenario and I am able to notice the same problem. For the sake of correction, I have logged this problem as PDFNEWNET-36623 in our issue tracking system. We will further look into the details of this problem and will keep you updated on the status of correction. Please be patient and spare us little time. We are sorry for this inconvenience.
Hi Neil,
In addition to Nayyer’s comments, please note that PDF is created dynamically and in order to get real PDF document, the PDF engine needs to render its programming/dynamic model, so the actual structure is created. So please break your scenario into two parts. Create your PDF document and save it into a stream and then reopen it and add images on respective pages. Hopefully, it will help you to accomplish your task.
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
doc.save(outputStream);
doc = new Document( new ByteArrayInputStream(outputStream.toByteArray()));
Please feel free to contact us for any further assistance.
Best Regards,
The issues you have found earlier (filed as PDFNEWNET-36623) have been fixed in Aspose.Pdf for .NET 9.1.0.
For further details, you may check this blog post.
Hi Neil,
In order to generate correct output, please try using following code snippet.
string outFile = TestSettings.GetOutputFile("36623.pdf");
string inFile = TestSettings.GetInputFile("../Generator/36163.bmp");
//open document
Document pdfDocument = new Document();
Page page = pdfDocument.Pages.Add();
Aspose.Pdf.Table table = new Aspose.Pdf.Table();
// SetupTable(out table);
Aspose.Pdf.Row newRow;
for (int counter = 0; counter <= 100; counter++)
{
newRow = table.Rows.Add();
newRow.Cells.Add("Sample Cell" + counter);
}
page.Paragraphs.Add(table);
pdfDocument.Save(outFile);
pdfDocument = new Document(outFile);
FileStream fs = new FileStream(inFile, FileMode.Open);
foreach (Page innerpage in pdfDocument.Pages)
{
AddImage(innerpage, fs, 100, 100, 100);
}
pdfDocument.Save(outFile);