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
|