Create a Fax job from c#

P

Pj

Hi

Is there any way I can obtain a Graphics object for a fax print job in
c#, In the same way I can call FaxStartPrintJob in MFC to get a device
context (And then use GDI calls to build up the page)

Thanks for any help!

Pj
 
A

Alex Feinman [MVP]

I haven't tried it, but you should be able to P/Invoke FaxStartPrintJob, get
your HDC and use Graphics.FromHdc() to obtain a Graphics object
 
P

Pj

Yeah, I was kind of thinking along those lines as well, just wonderd if
there was a native .net solution that I should be using!

Ideally I'd use a .net PrintDocument just pointing to the fax server,
but see no way of inputing stuff like the dest. fax number
programatically ( Not actually tried this, but assume I would just get
the usual send fax dialog popping up wanting the params for the job if
I tried this )

Thanks!

Pj
 
Joined
May 3, 2006
Messages
2
Reaction score
0
ArgumentException was unhandled

Alex,

Your example code is awesome and looks like it would be a great solution for the app I'm working on. I'm running into a problem from this line of code in the MyPrinterSettings.cs:

typeof(StandardPrintController).GetField("dc", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(this, fci.hDC);

At run time with c# 2005 I get the error "Object of type 'System.IntPtr' cannot be converted to type 'System.Drawing.Internal.DeviceContext'."

I'm running out of ideas on how to fix this. I've tried different casting options and even marking the hDC as an unsafe pointer with no luck. Do you have any ideas how I could change the hDC to make it play nice with the setvalue? Any help would be greatly appreciated.

Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top