Print Page | Close Window

Unable to print Landscape

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=1904
Printed Date: 28 Aug 25 at 2:52AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Unable to print Landscape
Posted By: RedOctober
Subject: Unable to print Landscape
Date Posted: 31 Jul 11 at 4:51AM
I'm using Delphi 7, QuickPDFLibrary 725, the TPrintDialog component that comes with Delphi, and I'm printing to a new Ricoh color printer.

Here is a code snippet:

   if prntDlg.Execute then
        begin
...

qwk_pdf.PrintDocument(Printer.Printers[Printer.PrinterIndex], prntDlg.FromPage, prntDlg.ToPage, qwk_pdf.PrintOptions(0, 0, 'My Document'));

...

In the print dialog that pops, I see all the options for the Ricoh printer including landscape.  Yet when my user selects Landscape, the qwk_pdf always prints in Portrait mode.  Now I see in the code, that there is no option to tell qwk_pdf to print in landscape mode.

Can some one tell me how to get my qwk_pdf object to print in landscape mode when the user selects it from the TPrintDialog?  Thanks in advance.





Replies:
Posted By: Rowan
Date Posted: 01 Aug 11 at 4:47PM
Hi RedOctober,

Would you be able to upload the PDF that you're having trouble printing somewhere that we could take a look at? Post the link here...

Cheers,
- Rowan.


Posted By: RedOctober
Date Posted: 02 Aug 11 at 2:19AM
Hi Rowan, please see:

http://jetlyt.ca/doc/PrintMeLandscape.pdf
http://jetlyt.ca/doc/code_snippet.txt

Code snippet is my real code, +full of comments.
The Printer object is definitely set to poLandscape just prior to qwk_pdf.Print...



Posted By: RedOctober
Date Posted: 03 Aug 11 at 4:25PM
Hi Rowan, links to files posted as you requested.


Posted By: RedOctober
Date Posted: 07 Aug 11 at 8:38PM
Hoping to get an answer to this question.


Posted By: Rowan
Date Posted: 08 Aug 11 at 2:54PM
Sorry for the delay.

If you want to print landscape then you need to use the customer printer functions. The SetupCustomPrinter function lets you choose whether the printing orientation is landscape or portrait.

The SetupCustomPrinter function provides a variety of different settings for customizing your custom printer. To use the SetupCustomPrinter function you first need to create your customer printer using the the NewCustomPrinter function. Then you need to call the SetupCustomPrinter function. The trick to understanding this function is that you need to call it with the Setting parameter each time you want to add a new setting to your custom printer.

So for example, if you want to add a setting that dictates how many copies should be printed you would use:

SetupCustomPrinter(CustomPrinterName, 4, 10) Using the above setting will mean that 10 copies of the document that you send to this custom printer will be printed.

If you wanted to then also adding a setting specifying the print quality you would use:

SetupCustomPrinter(CustomPrinterName, 5, 4) This would now mean that 10 copies of the document that you send to this custom printer will be printed and all of the printed pages will have a draft print quality.

Simply put you need to repeatedly the SetupCustomPrinter function until you've added all of the required settings.


Posted By: RedOctober
Date Posted: 08 Aug 11 at 4:11PM
Ok, now I am pointed in the right direction.  Thanks Rowan.



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