views:

324

answers:

1

Hi all,

I am trying to write a form to help users make canned pdfs

im working with Itextsharp.dll and im walking through the tutoral HERE and im getting an error that seems to be over the keyword "FONT"

if i hightlight over the first error i get

Error   1 'Font' is an ambiguous reference between 'System.Drawing.Font' and 'iTextSharp.text.Font'

I understand that they both have a keyword font but im unclear on how to proccede to fix this issue

+1  A: 

I assume the error is on this line from your link:

Font[] fonts = new Font[14];

You need to specify which Font you mean, the one from the System.Drawing namespace or the one from iTextSharp.text namespace. If you mean from the iTextSharp.text namespace, change the line to this:

iTextSharp.text.Font[] fonts = new iTextSharp.text.Font[14];

On the example the following lines require referencing the Font object from the System.Drawing namespace:

fonts[0] = FontFactory.getFont(FontFactory.COURIER, 12, Font.NORMAL);

You'll need to update these like so:

fonts[0] = FontFactory.getFont(FontFactory.COURIER, 12, System.Drawing.Font.NORMAL);
Jay Riggs