PrintDocument and specific Trays

  • Thread starter Thread starter PMGuy
  • Start date Start date
P

PMGuy

Hi guys:

We're struggling with a peculiar user request.

We're re-implementing an application and a piece of the app allows the
users to print a letter and cooresponding envelope to a designated
printer with the letter being printed from the "Letterhead" tray and
the Envelope printing from the envelop feeder.

The Letterhead tray is NOT the default "LETTER" tray.

We have a routine that loops through the PaperSizes property to try to
specify which tray to use:

private PaperSize GetPaperSize(string sizeName, PrintDocument pDoc)
{
PaperSize res = null;
foreach ( PaperSize pSize in pDoc.PrinterSettings.PaperSizes )
{
if ( sizeName == pSize.PaperName.ToUpper() )
{
res = pSize;
break;
}
}
return res;
}

And this works great for the envelope, because there's only one feeder.


We have tried using a similar routine to loop through PaperSources, but
the only one that comes back is "Form Select" and I'm having the
darnedest time finding any kind of reference for that.

Has anyone else encountered anything like this? Or can you at least
point me in the right direction? We're completely stumped.

TIA.

Matt
 
One additional piece of information that may be helpful.

The old application is a PowerBuilder app that doesn't access the
PrintDocument object (obviously). It forces the app to print letters
to "Tray 2", something that I can't do because the
PrinterSettings.PageSources aren't getting populated with an array.

Is there an old Win32 API function that I can use? (there must be,
because the current app still works)
 
Quick Follow-up:

The old app is a PB app that seems to use the old Win32 API.

Since it still works on XP clients, I can only assume that MS/HP is
providing legacy support for this (and then the new functionality
doesn't work b/c hp doesn't write good drivers)

Does anyone know where I can get a reference library for the old Win32
API functions?

TIA.

Matt
 
Back
Top