PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Problem using rubberstamp
https://forum.pdfsharp.net/viewtopic.php?f=2&t=1005
Page 1 of 1

Author:  rcartoni [ Sun Jan 03, 2010 3:28 am ]
Post subject:  Problem using rubberstamp

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

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/