If you are truly using raw printer output, OpenPrinter etc, then changing DEVMODE will not have any effect, you are bypassing the printer driver. It is then completely up to you to rotate output. Quite painful if the printer itself doesn't support it. The kind where bypassing the driver makes sense never do. – Hans Passant Mar 18 '13 at 15:24. Foxit Quick PDF Library uses the standard Windows DEVMODE structure for printing which is used by many other programs as well. Unfortunately the printer driver manufacturers don’t use the values specified in the DEVMODE structure and instead use custom undocumented values. This means that the SetupCustomPrinter function works for many drivers but not every driver.
Hp Printer Driver
Nov 04, 2012 dmSize is the size of the public part of the devmode structure, (on my Win 7 laptop this is 220 bytes regardless of printer), dmExtra is the size of the private area of the devmode structure which varies from printer to printer. Both of these values are added together to allocate the right amount of memory. // Copy the old structure in to the new using which ever size is the // smaller. Devmode maybe from newer Devmode (not likely since there // is only one), or Devmode maybe a newer Devmode, in which case it // maybe larger, but the first part of the structure should be the same. // // DESIGN ASSUMPTION: the private DEVMODE structure only gets. Jul 08, 2008 I'm trying to modify.the. devmode in DrvDocumentEvent (or rather any other way to. transfer the filename in the DOCINFO structure to the. My printer driver needs to know the name of the. output file b/c it's a virtual printer driver, if that helps. It doesn't look like.the. devmode exists anymore at this.
Home›End UserDevmode Printer
ReportBuilder 14.07 Ent, Advantage Database, Delphi XE2
I have an end user report application where reports are loaded from file.
They preview and print to file correctly but will not print to a printer
coming up with the following message 'Windows cannot print due to a problem
with the current printer setup.' I could not see anything wrong with any
printer settings so compared the .rtm file with another application where i
do not have any problem. It was immediately obvious that the problem
reports all had a PrinterSetup.DevMode setting (see below) whereas my good
ones do not. If i remove that section then the report prints no problem.
However if i go back in and change the report the section gets reinstated
and i am back to the printing problem.
I can guess from the name that PrinterSetUp.DevMode is something to do with
development (?) but why does it appear and more importantly how can i avoid
it?
Thanks
Tim Murfitt
object repPlayer: TppReport
PassSetting = psTwoPass
PrinterSetup.BinName = 'Default'
PrinterSetup.DocumentName = 'Report'
PrinterSetup.Orientation = poLandscape
PrinterSetup.PaperName = 'A4'
PrinterSetup.PrinterName = 'Default'
PrinterSetup.SaveDeviceSettings = True
PrinterSetup.mmMarginBottom = 10000
PrinterSetup.mmMarginLeft = 10000
PrinterSetup.mmMarginRight = 10000
PrinterSetup.mmMarginTop = 10000
PrinterSetup.mmPaperHeight = 210000
PrinterSetup.mmPaperWidth = 297000
PrinterSetup.PaperSize = 9
PrinterSetup.DevMode = {
B4080000430061006E006F006E0020004D004700360031003000300020007300
6500720069006500730020005000720069006E00740065007200200028004300
000000000104060CDC00D80703DF8103010009009A0B3408640001001401FDFF
0200010000000100010041003400000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0100000002000000010000000100000000000000000000000000000000000000
D8070000424A444D060C00000000000044040000AD000000AD00000000000000
000000000100000008520000047400002C01000054010000604F0000E4700000
2C01000054010000604F0000E470000008520000047400002C01000054010000
54010000F4010000604F0000E47000002C0100005401000054010000F4010000
2C0100005401000054010000F4010000604F0000E47000005802580218004400
5200410046005400000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000530061006D0070006C00650020003100000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000001027000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000020000000300000003000000000000000200010000000000
0000000000000000000000000000020003000900090000000300000003000000
0200000000000000000000000000000000000000010000000100000003000000
1401000003000000000000000100000000000000000000000000000000000000
0000000003000000020000000100000000000000010000000000000000000000
6400000009000000085200000474000000000000090000000852000004740000
0000000002000000000000000100000001000000000000000000000000000000
0000000000000000000000000000000000000000930000000000000000000000
480A000001000000010000002C00000000000000000000000000000001000000
0000000001000000FFFF00000000000000000000000000000A00000000000000
0000000000000000000000000100000000000000000000000000000000000000
0100000000000000000000000000000000000000000000000000000001000000
00000000FFFF0000000000000000000000000000020000000000000000000000
0000000001000000000000000100000000000000000000000000000000000000
00000000085200000474000000000000010000007F0000007F0000007F000000
7F00000000000000010000000000000000000000E7030000FF00000000000000
0000000000000000000000000000000000000000000000000000000001000000
0000000000000000000000000B01000001000000090000000000000000000000
000000000000000000000000000000000B010000000000000000000000000000
0100000000000000000000000A00000000000000000000000000000000000000
E703000000000000000000000000000000000000000000000000000000000000
0000000005000000000000000000000002000000000000000200000001000000
0000000000000000000000000000000000000000E80300000000000001000000
000000000000000000000000000000000000000000000000430061006E006F00
6E0020004D004700360031003000300020007300650072006900650073002000
5000720069006E007400650072002000280043006F0000000104060CDC00D807
03DF8103010009009A0B3408640001001401FDFF020001000000010001004100
3400000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000010000000200000001000000
0100000000000000000000000000000000000000723850DE}
Template.FileName =
Comments
- edited May 2013After further experimenting i have discovered that if i edit the .rtm to
include PrinterSetup.DevMode = {00000000} then i can print ok and the
setting does not get overwritten when the report is modified. I have
therefore half resolved my problem (i can print) but i am still left with
the problem of having to edit the .rtm file.
Any one with ideas how i can completely resolve the problem?
Thanks
Tim Murfitt - edited May 2013In the Report properties below, I notice
PrinterSetup.SaveDeviceSettings = True
Use the object inspector to set SaveDeviceSettings to False. Save the
report and again do a View | As Text and the DevMode should no longer
appear. If you modify the PrinterSetup.DeviceSettings then
SaveDeviceSettings will flip to True. The DeviceSettings property should
only be used to set printer model specific features, like stapler, etc.
The Windows API 'DevMode' structure is used by Windows and the Printer
Driver to define the printer setup. The name DevMode is short for
DeviceMode.
-
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com - edited May 2013
Devmode Structure Printer Driver Downloads
Devmode Structure Printer Drivers
DocumentProperties(). Directly following the DEVMODE portion seems to be a
structure which I'm guessing belongs to UNIDRV. Comparing the data returned
from DocumentProperties() to the DefaultDevmode structure in the registry I
see the data UNID at the beginning of the structure. In the registry, my oem
data follows several hundred bytes after this. My problem is that I can't
figure out what the UNID structure is. It's not a DEVMODE or OEMDEV. Does
anyone know where I can find this structure?