Print Page | Close Window

Select printer tray

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2100
Printed Date: 17 Jun 25 at 10:15AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Select printer tray
Posted By: Alberto
Subject: Select printer tray
Date Posted: 12 Jan 12 at 10:23AM
Good morning.

I'm testing your demo dll.
Now i have this problem........
I'm try to use a 2 drawers printer on my network.
One is for A5 paper and the other is for A4 paper.

I would like to know if is possible during printig (function PRINTDOCUMENT, to select the correct tray (in my case the 2nd .... A4) 

thank you in advance
best regards




Replies:
Posted By: AndrewC
Date Posted: 12 Jan 12 at 11:00AM
You can use NewCustomPrinter and SetupCustomPrinter to change certain print parameters.

http://www.quickpdflibrary.com/help/quickpdf/SetupCustomPrinter.php - http://www.quickpdflibrary.com/help/quickpdf/SetupCustomPrinter.php

http://www.quickpdflibrary.com/faq/how-do-i-use-the-setupcustomprinter-function.php - http://www.quickpdflibrary.com/faq/how-do-i-use-the-setupcustomprinter-function.php
http://www.quickpdflibrary.com/faq/what-paper-size-values-can-be-used-with-the-setupcustomprinter-function.php - http://www.quickpdflibrary.com/faq/what-paper-size-values-can-be-used-with-the-setupcustomprinter-function.php
Andrew.


Posted By: Alberto
Date Posted: 12 Jan 12 at 1:41PM
thank you for your answer.

Can i found some vb.net example ????

thanks
regards




Posted By: Alberto
Date Posted: 12 Jan 12 at 2:06PM
I understand now...... but

this is my code:

    QP.LoadFromFile(filename, "")
            CustomPrinter = QP.NewCustomPrinter("\\server name\printer name")
            QP.SetupCustomPrinter(CustomPrinter, 9, 5)
            PrintOption = QP.PrintOptions(0, 0, "Test")
            QP.PrintDocument(CustomPrinter, 1, 1, PrintOption)

during printdocument i have an error.
and if i look inside CustomPrinter the value is "3 

customprinter is defined like string 

thanks
Regards



Posted By: AndrewC
Date Posted: 12 Jan 12 at 2:10PM

            QP.LoadFromFile("PrintDocumentTest.pdf", "");

            int op = QP.PrintOptions(1, 0, "My QPL PrintJob");

            string printer = QP.NewCustomPrinter(QP.GetDefaultPrinterName());

            int ret;

            ret = QP.SetupCustomPrinter(printer, 6, 1);  // Colour = Monochrome

            // see this link for other paper sizes.
            // http://www.quickpdflibrary.com/faq/what-paper-size-values-can-be-used-with-the-setupcustomprinter-function.php

            ret = QP.SetupCustomPrinter(printer, 9, 13);  // PaperTray = DMPAPER_B5

            ret = QP.PrintDocument(printer, 1, QP.PageCount(), op);



Posted By: Alberto
Date Posted: 12 Jan 12 at 2:13PM
thanks but here

Return dll.QuickPDFPrintDocument(instanceID, PrinterName, StartPage, EndPage, _
                    Options)

i have an error.

and printername = "2

.............



Posted By: AndrewC
Date Posted: 12 Jan 12 at 2:13PM

You need to choose your printer name from list created with QP.GetPrinterNames(); or QP.GetLatestPrinterNames().

Andrew




Posted By: Alberto
Date Posted: 12 Jan 12 at 2:35PM
ok..........
and if i want to use a particular printer ???

how can i get via getprinternames ???

thanks.
Alberto.




Posted By: Ingo
Date Posted: 12 Jan 12 at 7:23PM
Hi Alberto!

You should read in the online-reference here:
GetPrinterNames
http://www.quickpdflibrary.com/help/quickpdf/GetPrinterNames.php
NewCustomPrinter
http://www.quickpdflibrary.com/help/quickpdf/NewCustomPrinter.php
PrintDocument
http://www.quickpdflibrary.com/help/quickpdf/PrintDocument.php
Take the printername from the csv-list and insert it into PrintDocument.

Cheers and welcome here,
Ingo




Posted By: Alberto
Date Posted: 13 Jan 12 at 10:04AM
thank you for your answer............

i'm testing latest version and everything work fine !!!!!!




Posted By: Alberto
Date Posted: 13 Jan 12 at 11:07AM
Perfect !!!!!!!!!!!
Everything work good !!!!!!!

thank you for your support......

regards
Alberto.




Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk