Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
Another Changing Trays question |
Post Reply |
Author | |
BobW
Senior Member Joined: 27 Feb 13 Location: Minnesota Status: Offline Points: 64 |
Post Options
Thanks(0)
Posted: 17 Feb 20 at 4:32PM |
I also have a question about changing trays. Using the library, I can look at each page of my PDF and determine which tray I want to draw from. I created a custom printer and can change its tray during printing My problem is that it creates a new print spool job each time I switch trays. For instance if I see the first 5 pages go to tray 2: set the tray to 2 and PrintPages 1-5 then change the tray to 3 and PrintPages 6 then change the tray the back to 2 and PrintPages 7-11, etc. This can potentially create hundreds of spool jobs (I create a print very large PDFs). Is there any way I can perform this in a single print job? If not, this would be a great feature to add. Something like: StartPrinter print to tray 2 print to tray 3 print to tray 2 EndPrinter |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3527 |
Post Options
Thanks(0)
|
Hi Bob,
that's not possible: https://www.debenu.com/kb/can-print-different-printer-trays/ Ideas for further enhancements you should post into the official page regarding technical issues. Here's the user/user-community... |
|
Cheers,
Ingo |
|
jack97119
Beginner Joined: 28 Dec 21 Status: Offline Points: 3 |
Post Options
Thanks(0)
|
Printer.BeginDoc; //dosomething...print //--------- Changing Trays .... ----------------- Printer.GetPrinter(device, driver, port, hDMode); if (hDMode <> 0) then begin pDMode := GlobalLock(hDMode); if Assigned(pDMode) then begin pDMode.dmFields := pDMode.dmFields or DMBIN_MANUAL; pDMode.dmDefaultSource :=GetTraysID(); winapi.Windows.EndPage( Printer.Handle ); If ResetDC( Printer.canvas.Handle, pDMode^ ) = 0 Then showmessage( 'ResetDC failed, '+SysErrorMessage(GetLastError)); GlobalUnlock( hDMode ); winapi.Windows.StartPage( Printer.Handle ); Printer.Canvas.Refresh; end; //-------------------------------------------------- //dosomething...print Printer.EndDoc; end; Edited by jack97119 - 28 Dec 21 at 10:58AM |
|
jack97119
Beginner Joined: 28 Dec 21 Status: Offline Points: 3 |
Post Options
Thanks(0)
|
function GetTraysID()(TraysName: string; adevice, aport: PWideChar): Word;
var i, rslt: Integer; tBinNames: array of Tbinname; BinCodes: array of Word; begin Result := DM_DEFAULTSOURCE; rslt := devicecapabilitiesW(adevice, aport, dc_binnames, nil, nil); if rslt > 0 then begin setlength(tBinNames, rslt); setlength(BinCodes, rslt); try if devicecapabilitiesW(adevice, aport, dc_binnames, @tBinNames[0], nil) = -1 then begin setlength(BinCodes, 0); setlength(tBinNames, 0); raise exception.Create('error tbinnames'); end; if devicecapabilitiesW(adevice, aport, DC_BINS, @BinCodes[0], nil) = -1 then begin setlength(BinCodes, 0); setlength(tBinNames, 0); raise exception.Create('error BinCodes'); end; for i := 0 to rslt - 1 do begin if TraysName = tBinNames then begin Result := BinCodes; Break; end; end; finally setlength(BinCodes, 0); setlength(tBinNames, 0); end; end; end; |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store