The size of a paragraph is unknown until it is rendered.
I'm not absolutely sure, but it could be that you have to open images with PDFsharp's XImage class to determine their size.
There are no public samples yet, but it is possible to add an empty paragraph at the end of the contents. After rendering the page with MigraDoc you can determine the position of the paragraph on the page and then draw the image in the size you need, e.g. as large as the remaining space allows.
Every MigraDoc object has a Tag member that you can set to any object. This allows to identify a paragraph after rendering.
_________________ Best regards Thomas (Freelance Software Developer with several years of MigraDoc/PDFsharp experience)
|