My immediate idea is that you need additional paper size definitions
using so called "qualifiers" - see the Adobe PPD specification
for duplex printing in your PPDs together with matching constraints.
For example here only for A4 something like
(derived from HP-DeskJet_6540-hpijs.ppd):
-------------------------------------------------------
*UIConstraints: *PageSize A4 *Duplex DuplexNoTumble
*UIConstraints: *PageSize A4 *Duplex DuplexTumble
*UIConstraints: *Duplex DuplexNoTumble *PageSize A4
*UIConstraints: *Duplex DuplexTumble *PageSize A4
...
*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
*FoomaticRIPOptionSetting PageSize=A4: " -dDEVICEWIDTHPOINTS=595 &&
-dDEVICEHEIGHTPOINTS=842"
*End
*PageSize A4.Duplex/A4 for duplex printing: "%% FoomaticRIPOptionSetting: PageSize=A4"
*FoomaticRIPOptionSetting PageSize=A4: " -dDEVICEWIDTHPOINTS=595 &&
-dDEVICEHEIGHTPOINTS=822"
*End
...
*ImageableArea A4/A4: "9.72 36 585.28 833"
*ImageableArea A4.Duplex/A4 for duplex printing: "9.72 36 585.28 813"
-------------------------------------------------------
By the way:
The above values for A4 from your HP-DeskJet_6540-hpijs.ppd
for DEVICEWIDTHPOINTS and DEVICEHEIGHTPOINTS
seem not to match to the ImageableArea (i.e. what is set for
Ghostscript seems to be bigger than what fits into the
ImageableArea).
Please keep me informed how you like to solve it.
My immediate idea is that you need additional paper size definitions
using so called "qualifiers" - see the Adobe PPD specification
for duplex printing in your PPDs together with matching constraints.
For example here only for A4 something like 6540-hpijs. ppd): ------- ------- ------- ------- ------- ------- ------ onSetting: PageSize=A4" ionSetting PageSize=A4: " -dDEVICEWIDTHPO INTS=595 && OINTS=842" onSetting: PageSize=A4" ionSetting PageSize=A4: " -dDEVICEWIDTHPO INTS=595 && OINTS=822" ------- ------- ------- ------- ------- ------- ------
(derived from HP-DeskJet_
-------
*UIConstraints: *PageSize A4 *Duplex DuplexNoTumble
*UIConstraints: *PageSize A4 *Duplex DuplexTumble
*UIConstraints: *Duplex DuplexNoTumble *PageSize A4
*UIConstraints: *Duplex DuplexTumble *PageSize A4
...
*PageSize A4/A4: "%% FoomaticRIPOpti
*FoomaticRIPOpt
-dDEVICEHEIGHTP
*End
*PageSize A4.Duplex/A4 for duplex printing: "%% FoomaticRIPOpti
*FoomaticRIPOpt
-dDEVICEHEIGHTP
*End
...
*ImageableArea A4/A4: "9.72 36 585.28 833"
*ImageableArea A4.Duplex/A4 for duplex printing: "9.72 36 585.28 813"
-------
By the way: 6540-hpijs. ppd
The above values for A4 from your HP-DeskJet_
for DEVICEWIDTHPOINTS and DEVICEHEIGHTPOINTS
seem not to match to the ImageableArea (i.e. what is set for
Ghostscript seems to be bigger than what fits into the
ImageableArea).