Convert a PBM image to HP Printer Performance Architecture format. More information: https://netpbm.sourceforge.net/doc/pbmtoppa.html.
pbmtoppa path/to/image.pbm > path/to/output.ppa
pbmtoppa -d 300 -s a4 path/to/image.pbm > path/to/output.ppa