Dim rectangle As New Aspose.Pdf.Rectangle(lowerLeftX, lowerLeftY, upperRightX, upperRightY) Dim matrix As New Aspose.Pdf.DOM.Matrix(New Double() { rectangle.URX - rectangle.LLX, 0, 0, rectangle.URY - rectangle.LLY, rectangle.LLX, rectangle.LLY })
'Using ConcatenateMatrix (concatenate matrix) operator: defines how image must be placed page.Contents.Add(New Operator.ConcatenateMatrix(matrix)) Dim ximage As XImage = page.Resources.Images(page.Resources.Images.Count)
is working.
There is no explanation in class for the Aspose.Pdf.DOM.Matrix and no explanation of the parameters.
The Matrix class object initialization takes rectangle object as an argument and its used to add image inside PDF file. However, I suggest you to please try using following simple code snippet to add image inside PDF file.
[C#]
// instantiate Document object<o:p></o:p>
Document pdfDocument = newDocument();
// add page to pages collection of PDF
file
pdfDocument.Pages.Add();
// create image object
Aspose.Pdf.Image
image = new Aspose.Pdf.Image();
// specify the file for image object
image.File = "c:/pdftest/sample.png";
// add image to paragraphs collection
of first page of PDF document
But I need to put the image always on the to right corner maximised to the page width for each page (1 to 10 pages with its own image, one image per page)
This I can not do with the paragrah image add or ?
As per my understanding, you need to add the image to complete page area inside PDF document. If so is the case, then please set image dimensions equal to page dimensions and in order to add 10 images to 10 pages inside PDF file, you need to iterate through individual page inside PDF document.