PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Apr 28, 2024 8:37 am

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: Wed Dec 09, 2009 10:00 pm 
Offline

Joined: Wed Dec 09, 2009 9:54 pm
Posts: 3
Hello

I have been looking around for a decent api which can draw stuff on an existing PDF, but have yet to find anything good. Bbefore diving into it myself, I thought I should check with you guys first, so:

Using PDFSharp is it possible to:

    1. Load an existing PDF file
    2. Draw stuff on it (lines, curves, points...). Is it also possible to use transparency/apha channel here?
    3. Save the edited PDF to file

Thanks a lot!


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 10, 2009 8:49 am 
Offline
PDFsharp Guru
User avatar

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

Yes, can be done.

Look here:
http://www.pdfsharp.net/wiki/Watermark-sample.ashx

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 10, 2009 8:53 am 
Offline

Joined: Wed Dec 09, 2009 9:54 pm
Posts: 3
Lovely, thanks!

The example uses DrawString only.

I take it it would be possible to use drawing primitives as well (curves, lines ...)?


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 10, 2009 9:14 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
Variations 2 and 3 do not use DrawString, they use a Path.

You can use all available drawing routines on any PdfPage object (newly created or opened from a file).

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Tue Dec 15, 2009 9:26 am 
Offline

Joined: Wed Dec 09, 2009 9:54 pm
Posts: 3
Thanks, it works like a charm.

Drawing lines and fancy curves is a breeze, but how do I draw a single point? Using
Code:
DrawLine(pen, p0, p0)
does not produce anything (a line with zero length... well). Should I use
Code:
DrawEllipse
for that or what do you suggest?


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 350 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