PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Wed May 01, 2024 1:11 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Sun Jan 03, 2010 3:28 am 
Offline

Joined: Wed Dec 23, 2009 2:18 pm
Posts: 1
Unable to get rubberstamp to produce anything but a rectangle in the middle of the page.

Here's the code:

] PdfDocument document = new PdfDocument();

// Create an empty page
PdfPage page = document.AddPage();

// Get an XGraphics object for drawing
XGraphics gfx = XGraphics.FromPdfPage(page);

// Create a font
XFont font = new XFont("Verdana", 20, XFontStyle.BoldItalic);

PdfRubberStampAnnotation rsAnnot = new PdfRubberStampAnnotation();
rsAnnot.Icon = PdfRubberStampAnnotationIcon.TopSecret;
rsAnnot.Flags = PdfAnnotationFlags.ReadOnly;
rsAnnot.Opacity = .1;

XRect rect = gfx.Transformer.WorldToDefaultPage(new XRect(new XPoint(100, 400), new XSize(350, 150)));
rsAnnot.Rectangle = new PdfRectangle(rect);

// Add the rubber stamp annotation to the page
page.Annotations.Add(rsAnnot);

const string filename = "rubberStamp.pdf";
document.Save(filename);
// ...and start a viewer.
Process.Start(filename);

Thanks


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

All times are UTC


Who is online

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