Page 1 of 1

Have the parameters Selecting a printer

PostPosted: Mon Jan 15, 2024 9:11 am
by Silvio.Falconi
local aPrn := GetPrinters()

Can I automatically have the following parameters of the printer I am going to use?

nPageWidth
nPageHeight
nXOffSet
nYOffSet
nPort

Re: Have the parameters Selecting a printer

PostPosted: Mon Jan 15, 2024 9:49 am
by Otto
What are these values used for in your program?
I think you always have to set your desired/required values before printing.

Re: Have the parameters Selecting a printer

PostPosted: Mon Jan 15, 2024 10:00 am
by Silvio.Falconi
Otto wrote:What are these values used for in your program?
I think you always have to set your desired/required values before printing.


NO it's wrong !!!

as I already told you in another topic
when the end user selects the printer
the computer changes some vital parameters for printing among which
xOffset and Yoffset
if I assign the value 0 to these parameters
the printer puts the value 94.94


I need to Know

PaperWidth
PaperHeight
TopMargin
LeftMargin
PageBreak
Orientation
XOffSet
YoffSet

therei s not none sample on fw\samples for Know all paramter of a printer

Re: Have the parameters Selecting a printer

PostPosted: Mon Jan 15, 2024 11:36 am
by Otto

Re: Have the parameters Selecting a printer

PostPosted: Mon Jan 15, 2024 2:34 pm
by Otto
The values you're looking for, such as PaperWidth, PaperHeight, TopMargin, LeftMargin, PageBreak,
Orientation, XOffSet, and YOffSet, are typically part of a printer's Device Mode (DevMode) structure.
This structure contains information about a printer's capabilities and print job configuration.

This array represents the DevMode structure for the printer.

Access the DevMode Structure: This can be done by either using Windows API calls (which would require a programming language like C# or C++ and cannot be directly
done in PowerShell) or by using a printer configuration tool or dialog that can interpret this information.