PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Section.Headers.Primary.AddImage overloads
https://forum.pdfsharp.net/viewtopic.php?f=4&t=1048
Page 1 of 1

Author:  irusoh [ Mon Feb 08, 2010 10:31 pm ]
Post subject:  Section.Headers.Primary.AddImage overloads

The only version of AddImage available has string parameter to read from file.
Is it possible to add more overloads such as

AddImage(System.Drawing.Image image) // such as Bitmap
AddImage(XImage ximage)
AddImage(Stream stream)
AddImage(byte[] bytes)

Or if anything similar is already available can you point me out to those features.

I saw some examples of how bitmaps can be converted to XImages and then placed firectly on the page canvas. But it seems cumbersome.

I was using Invoice sample for my project but my images come directly from DB converted to Bitmap. So instead of writing bitmap back to file then adding to page, rendering the pdf document then deleting bitmap file it could be handy just to add Bitmaps directly in
section.Headers.Primary.AddImage(mybitmap).

Thank you.

Author:  Thomas Hoevel [ Tue Feb 09, 2010 8:59 am ]
Post subject:  Re: Section.Headers.Primary.AddImage overloads

irusoh wrote:
Is it possible to add more overloads [...]

MigraDoc currently requires filenames because of how persistency is implemented.
I'm afraid that images passed in as an Image or XImage would not show in the Page Preview, and would get lost during serialization.

Apart from that, this should be rather simple to implement (at least for server-based applications that create PDF directly without preview).

Author:  gastan [ Fri Jun 15, 2012 8:07 pm ]
Post subject:  Re: Section.Headers.Primary.AddImage overloads

I do have server based application, please do advise how to add pictures without saving them.
thx

Author:  () => true [ Sat Jun 16, 2012 8:54 am ]
Post subject:  Re: Section.Headers.Primary.AddImage overloads

gastan wrote:
please do advise how to add pictures without saving them.
See here:
viewtopic.php?p=4123#p4123

Author:  gastan [ Sun Jun 17, 2012 1:55 pm ]
Post subject:  Re: Section.Headers.Primary.AddImage overloads

thx, this could help!

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/