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

'Printing' ambiguous in PdfSharp.Pdf and System.Drawing
https://forum.pdfsharp.net/viewtopic.php?f=2&t=3178
Page 1 of 1

Author:  JohnK [ Thu Aug 20, 2015 8:21 am ]
Post subject:  'Printing' ambiguous in PdfSharp.Pdf and System.Drawing

Hi,

I recently came across PdfSharp because I needed a tool that can produce pdf files through my project.

I am using Visual Basic .Net (VS 2013) targeting .NET Framework 4.5. I downloaded the assemblies and added a reference to the PdfSharp.dll in the GDI+ folder. I also imported PdfSharp, PdfSharp.Drawing and PdfSharp.Pdf in the Declarations.

Now, when I start debugging, I am get this exact error message: "'Printing' is ambiguous, imported from the namespaces or types 'PdfSharp.Pdf, System.Drawing'."

This error points to a private sub from a document printpage, which works just fine (I was using it before adding PdfSharp).

I realize that "printing" is a class that is declared in both System.Drawing and PdfSharp.dll but unfortunately I need both of them.

Can anyone help? Thank you all in advance.

Author:  Thomas Hoevel [ Thu Aug 20, 2015 8:26 am ]
Post subject:  Re: 'Printing' ambiguous in PdfSharp.Pdf and System.Drawing

Hi!
JohnK wrote:
Can anyone help?
I am no VB.NET expert and without an SSCCE there is nothing I can do.

Is it a run-time error or a compile-time error?
Try to replace "Printing" with "System.Drawing.Printing" in that "private sub" and see if that makes a difference.

Author:  JohnK [ Thu Aug 20, 2015 9:01 am ]
Post subject:  Re: 'Printing' ambiguous in PdfSharp.Pdf and System.Drawing

Wow, that was an extremely quick response. Thanx.

I forgot to mention that I downloaded the PDFSharp assemblies version 1.31 a couple of days ago. That's the version that I use. Also, the error that I get is a compile time error.

And as you proposed, changing to "System.Drawing.Printing" at the sub did the job. I am a bit of a "newbie" so please forgive me for not thinking this earlier.

Thumbs up to the PDFSharp team. Thank you very much and keep up the good work.

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