# Help sought for understanding PPD files



## rawthey (Nov 13, 2022)

I've installed a new HP Officejet Pro 8210 printer which I access over the network. Everything appeared to work fine except that when I tried to print anything on A4 sheets the option to select duplex printing was greyed out. The duplex option was available if I selected 'Letter' size.

```
curlew:/tmp% pkg info -x cups hplip
cups-2.4.2
cups-filters-1.28.15_5
cups-pdf-3.0.1_2
hplip-3.22.4
```
On examining the PPD file there were 'PageSizeVsDuplex' lines for many page sizes e.g.

```
*cupsUIConstraints PageSizeVsDuplex: " *Duplex *PageSize A5
```
but nothing for A4. So I tried adding this line:

```
*cupsUIConstraints PageSizeVsDuplex: " *Duplex *PageSize A4
```
With this line added the duplex option was no longer greyed out and I was able to print on both sides of the paper but whenever I attempted to do any duplex printing there was a message saying:

```
There are conflicts in duplex settings. Do you want to fix them?
```
 If I replied 'No' fo the message duplex printing worked OK but the messages are irritating.

I was able to print double sided A4 from a Linux PC without any problems. The PPD file on the Linux machine was very similar with only the following differences apart from some translation sections:

```
--- HP_OfficeJet_Pro_8210-freebsd.ppd   2022-11-13 16:29:12.445109000 +0000
+++ HP_OfficeJet_Pro_8210-linux.ppd     2022-11-13 16:31:16.215864000 +0000
@@ -382,4 +382,4 @@
-*HPPJLOutputMode GeneralOffice/General Office: "%%"
-*HPPJLOutputMode Professional/Professional: "%%"
-*HPPJLOutputMode Presentation/Presentation: "%%"
-*HPPJLOutputMode MaximumDPI/Maximum dpi: "%%"
+*HPPJLOutputMode GeneralOffice/General Office: ""
+*HPPJLOutputMode Professional/Professional: ""
+*HPPJLOutputMode Presentation/Presentation: ""
+*HPPJLOutputMode MaximumDPI/Maximum dpi: ""
@@ -419,3 +419,3 @@
-*HPPJLColorAsGray Off/Off: "%%"
-*HPPJLColorAsGray HighQuality/High Quality: "%%"
-*HPPJLColorAsGray BlackInkOnly/Black Ink Only: "%%"
+*HPPJLColorAsGray Off/Off: ""
+*HPPJLColorAsGray HighQuality/High Quality: ""
+*HPPJLColorAsGray BlackInkOnly/Black Ink Only: ""
```
I don't know what the significance of the %% characters is but the changes don't look like they'd be relevant to duplex printing but, as an experiment, I replaced the PPD file with the one from Linux and discovered that the duplex option was available despite not having a 'PageSizeVsDuplex' line for A4 and there were no warning messages.

So I can now produce double sided A4 output without any problems but I'm puzzled why the change from "%%" to "" in some apparently unrelated sections had this effect and also wonder if there may be some undesirable consequence which I haven't come across yet.

I've attached the PPD file which I'm now using and was copied from the Linux system


----------



## chrbr (Nov 14, 2022)

With cups the printer can be configured with a browser. Please connect to localhost:631. Either you can find the printer in the list or you select the ppd file directly.


----------



## shepper (Nov 14, 2022)

Consider running diff(1) on both *ppd files to see the full extent of the differences.


----------



## rawthey (Nov 14, 2022)

chrbr said:


> With cups the printer can be configured with a browser. Please connect to localhost:631. Either you can find the printer in the list or you select the ppd file directly.


Yes, that's what I did. Initially I used cups to add the new printer and selected 'HP OfficeJet Pro 8210 Postscript (recommended)' from the drop down list for HP printers. But with that setup I had the problem with duplex printing so I copied the PPD file from a Linux laptop and used cups to modify the printer by using the option to browse to my copy of the Linus file. Duplex printing with the Linux version of the file works fine even though the small number of differences between the two versions don't look to be relevant to duplex printing.


----------



## rawthey (Nov 14, 2022)

shepper said:


> Consider running diff(1) on both *ppd files to see the full extent of the differences.


I did that, it produced over 300 lines of output but most of them related to translations and all involved changing "%%" to "", e.g.

```
@@ -586,5 +586,5 @@
-*de.Translation HPPJLOutputMode/Druckqualität: "%%"
-*de.HPPJLOutputMode GeneralOffice/Allgemeine Büroarbeiten: "%%"
-*de.HPPJLOutputMode Professional/Für professionelle Verwendung: "%%"
-*de.HPPJLOutputMode Presentation/Präsentation: "%%"
-*de.HPPJLOutputMode MaximumDPI/Maximale Auflösung (dpi): "%%"
+*de.Translation HPPJLOutputMode/Druckqualität: ""
+*de.HPPJLOutputMode GeneralOffice/Allgemeine Büroarbeiten: ""
+*de.HPPJLOutputMode Professional/Für professionelle Verwendung: ""
+*de.HPPJLOutputMode Presentation/Präsentation: ""
+*de.HPPJLOutputMode MaximumDPI/Maximale Auflösung (dpi): ""
```
So, for brevity, I left all the translation ones out as not being relevant and showed the remaining diffs in my original post above.


----------



## chrbr (Nov 14, 2022)

Dear rawthey,
I have had an issue with Debian and a printer which wortked on FreeBSD and also in an ancient Debian release. I just did not succeed to make it work on the actual Debian Bullseye. The only cure was to uninstall cups and delete all configs. After a reinstall of cups things have been fine. I know that Debian dumps almost everything in /etc and /usr/bin. I do not know if this dumb method is useful on a FreeBSD system because everything is better sorted and tidy. But as a last resort it might be an option to try the dumb way.


----------



## astyle (Nov 14, 2022)

When I needed to make a printout, I usually put in some effort to organize the info so that it all fits on one page. 

My reasoning was that if I need to give someone a piece of paper, I don't expect the recipient to _have to_ actually look on both sides of the paper for important info.  Important info needs to be able to make it from your phone into their database, unvarnished.

This is coming from someone who still has an hplip-compatible printer that is over 10 years old by now... if I need to print something out double-sided (which is not often), I'd print first the even pages (Last to first), and then flip the paper over, and print odd pages (first to last).


----------



## shepper (Nov 14, 2022)

rawthey said:


> I did that, it produced over 300 lines of output but most of them related to translations and all involved changing "%%" to "", e.g.
> 
> ```
> @@ -586,5 +586,5 @@
> ...


editors/vim, and likely other editors, has a find and replace:  "%%" ->"".


----------



## astyle (Nov 14, 2022)

shepper said:


> editors/vim-gtk3, and likely other editors, has a find and replace:  "%%" ->"".


Real UNIX users use /bin/sed for this: `cat diff.txt | sed -i 's/\%\%/ /g' diff.txt`


----------

