PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Apr 26, 2024 4:56 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Wed Apr 06, 2016 10:09 pm 
Offline

Joined: Wed Apr 06, 2016 9:59 pm
Posts: 2
Hello, I'm having a hard time trying to figure out how graphics/basic shapes work Migradoc. I see in the API/Intellisense that we have MigraDoc.DocumentObjectModel.Shapes available to us...

I have a good grasp of the section/table/paragraph and all of their settings and configurations down, so I'm not completely new to this library.

Now, I just need to know how to create basic shapes (like a rectangle or square or circle). I've looked all over the web, but all I see are solutions for PDFSharp. Any help or nudge in the right direction would be greatly appreciated.

Thanks!


Top
 Profile  
Reply with quote  
PostPosted: Thu Apr 07, 2016 7:47 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
Hi!

Classes that derive from Shape are Barcode, Chart, Image, and TextFrame. To draw rectangles, circles and such you will have to implement own code, probably derived from Shape.

Or use a simple approach: use PDFsharp to draw on a PDF page and include that PDF page in MigraDoc like you would use an image. This allows you to have rectangles, lines, circles in vector format.
Or use the Mix MigraDoc and PDFsharp approach, create a PDF from MigraDoc and use PDFsharp to add the drawings later.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Apr 07, 2016 2:27 pm 
Offline

Joined: Wed Apr 06, 2016 9:59 pm
Posts: 2
Thomas Hoevel wrote:
Hi!

Classes that derive from Shape are Barcode, Chart, Image, and TextFrame. To draw rectangles, circles and such you will have to implement own code, probably derived from Shape.

Or use a simple approach: use PDFsharp to draw on a PDF page and include that PDF page in MigraDoc like you would use an image. This allows you to have rectangles, lines, circles in vector format.
Or use the Mix MigraDoc and PDFsharp approach, create a PDF from MigraDoc and use PDFsharp to add the drawings later.


Is there any documentation available for implementing my own code from Shape?


Top
 Profile  
Reply with quote  
PostPosted: Thu Apr 07, 2016 7:37 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 916
Location: CCAA
ktpdf wrote:
Is there any documentation available for implementing my own code from Shape?
There is the documented source code for Shapes and the derived classes.
I have no idea how difficult it is to implement a new derived class.

I'd try the other options.

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


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

All times are UTC


Who is online

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