printer object and printer margins 
Author Message
 printer object and printer margins

I have to print text on preprinter paper (A4).

I have calculated the offset x and y for each letter in millimeters.

I use printer object (scalemode, currentx, currenty and so on...)

I use a printer hp deskjet and everything is ok but when i try to print
with a canon printer the offsets are shifted right and down
of a fixed quantity (3 mm...).

I tryed to detect those margins (left and top) using printer.width,
scalewidth, papersize...

Please help me!
The problem seems trivial so it's a good challenge ;-)

bye
                            redmond



Wed, 13 Mar 2002 03:00:00 GMT  
 printer object and printer margins
Each printer has it's own *non-printable* margins.
You can get these margins using the GetDeviceCaps API.

    LeftMargin = Printer.ScaleX(GetDeviceCaps(Printer.hdc, _
        PHYSICALOFFSETX), vbPixels, vbMillimeters )

    TopMargin = Printer.ScaleY(GetDeviceCaps(Printer.hdc, _
        PHYSICALOFFSETY), vbPixels, vbMillimeters )

Simply subtract these from the x, y position you want to print at (shown
here in millimeters).

David

Quote:

>I have to print text on preprinter paper (A4).

>I have calculated the offset x and y for each letter in millimeters.

>I use printer object (scalemode, currentx, currenty and so on...)

>I use a printer hp deskjet and everything is ok but when i try to print
>with a canon printer the offsets are shifted right and down
>of a fixed quantity (3 mm...).

>I tryed to detect those margins (left and top) using printer.width,
>scalewidth, papersize...

>Please help me!
>The problem seems trivial so it's a good challenge ;-)

>bye
>                            redmond



Wed, 13 Mar 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. printer object and printer margins

2. printer object and printer margins

3. Controlin printer margins when using the Printer.Object

4. Q: how to get and set printer's margins with the Printer object

5. How to deal with printer margins/printable area for different printers

6. Richtextbox, Printer Object and Margin.

7. VB 4.0 Printer Object - Setting Margins

8. print margins using the Printer object

9. Margins on Printer Object?

10. The Printer Object and Margins

11. Printer Object - Getting the available printer information

12. VBA: Printer Object / Printer Collection

 

 
Powered by phpBB® Forum Software