Hi!
I'm testing how the SDK works with images. I have created a view where I draw some lines, then i get its bitmap (i have checked it's not null setting it in an ImageView) and have tried to insert it in the PDF unsuccesfuly.
I have used this method I create in PDFLayoutView:
public void addImage(Bitmap image) {
Page page = m_doc.GetPage(m_pageno);
if (page != null)
{
Document.DocImage docImage = m_doc.NewImage(image, true);
PageContent pageContent = new PageContent();
pageContent.Create();
pageContent.GSSave();
com.radaee.pdf.Matrix mat = new com.radaee.pdf.Matrix(200, 112.5f, 100, 300);
pageContent.GSSetMatrix(mat);
mat.Destroy();
ResImage rimage = page.AddResImage(docImage);
pageContent.DrawImage(rimage);
pageContent.GSRestore();
page.AddContent(pageContent, false);
pageContent.Destroy();
page.Close();
m_doc.Save();
}
}
The bitmap has been created with a canvas, drawing on it. When i execute that method, there is no feedback or behaviour in the UI lo let me know anything has happened to that PDF (the image is not inserted). When I re-open the app the PDF document has no changes.
Why the method is not working? How can I add an image in a certain position from the pdf page (for example, at the bottom Y pdf from the bottom and X from the right, like a signature?