I've been looking around on what's the best way to add a checkbox to a PDFsharp document.
So far I'm only able to add a string "\u00fd"
with the Wingdings font. It kinda works only if the PDF document is opened with the Acrobat Reader. But if Chrome or IE opens it, instead of a checkbox, it will show a unreadable character.
Any ideas or better alternative (free or open source) to PDFsharp?
My requirement for the PDF document is very easy and just one or two reports.
Followed links provided by PDFsharp Novice to embed the font.
Draw the checkbox:
XPdfFontOptions options = new XPdfFontOptions(PdfFontEncoding.Unicode,
PdfFontEmbedding.Always);
XFont prevCheckboxFont = new XFont("WingDings", 12, XFontStyle.Regular, options);
XRect prevCheckboxPos = new XRect(XUnit.FromInch(3.20), XUnit.FromInch(3.30),
XUnit.FromInch(1.25), XUnit.FromInch(.10));
string prevCheckboxText = "\u00FE";
gfx.DrawString(prevCheckboxText, prevCheckboxFont, XBrushes.Black,
prevCheckboxPos, XStringFormats.TopLeft);