PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 2:38 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Mon Feb 08, 2010 10:31 pm 
Offline

Joined: Mon Feb 08, 2010 10:12 pm
Posts: 1
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.


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 09, 2010 8:59 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
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).

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 15, 2012 8:07 pm 
Offline
Supporter

Joined: Sat Oct 18, 2008 4:15 pm
Posts: 50
I do have server based application, please do advise how to add pictures without saving them.
thx


Top
 Profile  
Reply with quote  
PostPosted: Sat Jun 16, 2012 8:54 am 
Offline
PDFsharp Expert
User avatar

Joined: Wed Dec 09, 2009 8:59 am
Posts: 339
gastan wrote:
please do advise how to add pictures without saving them.
See here:
viewtopic.php?p=4123#p4123

_________________
Öhmesh Volta ("() => true")
PDFsharp Team Holiday Substitute


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 17, 2012 1:55 pm 
Offline
Supporter

Joined: Sat Oct 18, 2008 4:15 pm
Posts: 50
thx, this could help!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 39 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group