PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Jul 03, 2020 7:14 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Add image to section
PostPosted: Sun Apr 05, 2020 6:58 pm 
Offline

Joined: Sun Apr 05, 2020 6:50 pm
Posts: 3
Hi, I tried to use some of the code from http://www.pdfsharp.net/wiki/HelloMigraDoc-sample.ashx


Image image = section.AddImage("../../images/Logo landscape.png");

Receiving an error "Cannot implicitly convert type MigraDoc.DocumentObjectModel.Shapes.Image to System.Drawing.Image"

What I'm doing wrong!!

Cheers,
brucey54


Top
 Profile  
Reply with quote  
 Post subject: Re: Add image to section
PostPosted: Mon Apr 06, 2020 2:00 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 545
Location: CCAA
Too many usings.

Change this to "MigraDoc.DocumentObjectModel.Shapes.Image image = [...]" to make it work.
Or just "var image = [...]" for brevity.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
 Post subject: Re: Add image to section
PostPosted: Mon Apr 06, 2020 3:42 pm 
Offline

Joined: Sun Apr 05, 2020 6:50 pm
Posts: 3
Thanks


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 8 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