landscape/portrait print problem 
Author Message
 landscape/portrait print problem

I have a simple routine which will change the print orientation to either
landscape or portrait.  It works well, but seems to {*filter*}for some reason with
some types of printers (injet/bublejet types)

Here is the routine....

Sub landsport (i%)
    If i% = 1 Then o& = 1& Else o& = 2&
    Dim orient As orientstructure
    orient.orientation = o&
    xx% = escape(printer.hDC, 30, Len(orient), orient, 0&)

    Print xx%
    printer.EndDoc
End Sub

Is there anything I am missing here?

BTW this is VB3.0

Thanks,

Steve Salter



Wed, 16 May 2001 03:00:00 GMT  
 landscape/portrait print problem

Quote:

>I have a simple routine which will change the print orientation to either
>landscape or portrait.  It works well, but seems to {*filter*}for some reason with
>some types of printers (injet/bublejet types)
>    orient.orientation = o&
>    xx% = escape(printer.hDC, 30, Len(orient), orient, 0&)
>Is there anything I am missing here?

Not really. The function you're calling is actually executed by the
printer driver. A different printer means a different printer driver.
That's why the same code might act differently on different printers.
Call it a printer driver bug if you like. :-)

In his API book, Appleman calls this function obsolete, because it can
(and should) be replaced with calls to DeviceCapabilities/ExtDeviceMode.
Obsolete functions are allowed to be buggy ;-).

Unfortunately these are in the printer driver, which means you can't
just do it in plain VB, unless you hardcode the printer driver (=DLL)'s
name in your VB code.

The book is accompanied by a free-to-use DLL which can be used as an
interface layer for these functions to any printer driver.

My advice would be: get the book, and use ExtDeviceMode.

   HTH,
   Bart.



Thu, 17 May 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Printing landscape vs portrait

2. Mixing portrait and landscape printing in VB5

3. how to combine landscape and portrait printing

4. Printing forms using printer driver (need landscape/portrait)

5. Mixing landscape and portrait printing

6. Changing print option to portrait/landscape

7. Changing Print option to Portrait/Landscape

8. Changing Print Option to Portrait/Landscape

9. Changing print option - portrait/landscape

10. Printing in landscape and portrait mode in the same document

11. CR.NET previews in landscape, but prints portrait

12. Printing: Portrait/Landscape

 

 
Powered by phpBB® Forum Software