Hello Branden, > I'm sorry I let this fall onto the floor. Picking it up...
That's alright; thanks for picking it up again, much appreciated! > groff runs it unconditionally if the output device is "html" (or "xhtml"), > because the "html" device's "DESC" file tells it to. Ah, that's the piece I was missing, thanks! > Another way to make sure your code is being exercised is to stick a > `debug()` call into it. That's helpful to know. I've done this locally and verified that things work and seem to produce visually equal results¹ when looking at the generated html for pic and webpage pages in the doc directory. Please find attached a patch that, to the best of my knowledge, replaces psselect with ps2ps in code and documentation. Note that the documented use of psselect in contrib/momdoc—describing how to rearrange a table of contents generated at the end of a document when using the ps output device—is unchanged as I did not find a suitable replacement. According to the Ghostscript documentation for the -sPageList option: "[f]or PostScript or PCL input files, the list of pages must be given in increasing order, you cannot process pages out of order or repeat pages and this will generate an error."² Do let me know if you desire or require further testing or changes, or if I can be helpful in other ways to drive this change forward. Best Alexis ¹ Checking the differences between the generated images using https://github.com/x1ddos/imgdiff the reported difference was below 0.01% ² https://ghostscript.readthedocs.io/en/latest/Use.html
diff --git b/m4/groff.m4 a/m4/groff.m4 index ebbe60d52..d5f014316 100644 --- b/m4/groff.m4 +++ a/m4/groff.m4 @@ -182,7 +182,7 @@ AC_DEFUN([GROFF_CHECK_GROHTML_PROGRAMS], [ missing= m4_foreach([groff_prog], dnl Keep this list of programs in sync with grohtml test scripts. - [[pnmcrop], [pnmcut], [pnmtopng], [pnmtops], [psselect]], [ + [[pnmcrop], [pnmcut], [pnmtopng], [pnmtops], [ps2ps]], [ AC_CHECK_PROG(groff_prog, groff_prog, [found], [missing]) if test $[]groff_prog = missing then diff --git b/src/devices/grohtml/grohtml.1.man a/src/devices/grohtml/grohtml.1.man index ef617703f..e10091bf2 100644 --- b/src/devices/grohtml/grohtml.1.man +++ a/src/devices/grohtml/grohtml.1.man @@ -303,11 +303,12 @@ These include the \%Netpbm tools .IR \%pnmcrop , .IR \%pnmcut , and -.IR \%pnmtopng ; -\%Ghostscript -.RI ( gs ); -and the \%PSUtils tool -.IR \%psselect . +.IR \%pnmtopng +as well as +\%Ghostscript's +.IR \%gs +and +.IR \%ps2ps . . . .\" ==================================================================== diff --git b/src/preproc/html/pre-html.cpp a/src/preproc/html/pre-html.cpp index cbcc2ccda..401c275cb 100644 --- b/src/preproc/html/pre-html.cpp +++ a/src/preproc/html/pre-html.cpp @@ -918,7 +918,7 @@ int imageList::createPage(int pageno) fprintf(stderr, "creating page %d\n", pageno); #endif - s = make_string("psselect -q -p%d %s %s\n", + s = make_string("ps2ps -sPageList=%d %s %s\n", pageno, psFileName, psPageName); html_system(s, 1); assert(strlen(image_gen) > 0); diff --git b/src/roff/groff/tests/html_works_with_grn_and_eqn.sh a/src/roff/groff/tests/html_works_with_grn_and_eqn.sh index e0709440f..b3b2dc5cd 100755 --- b/src/roff/groff/tests/html_works_with_grn_and_eqn.sh +++ a/src/roff/groff/tests/html_works_with_grn_and_eqn.sh @@ -22,7 +22,7 @@ groff="${abs_top_builddir:-.}/test-groff" # Keep this list of programs in sync with GROFF_CHECK_GROHTML_PROGRAMS # in m4/groff.m4. -for cmd in pnmcrop pnmcut pnmtopng pnmtops psselect +for cmd in pnmcrop pnmcut pnmtopng pnmtops ps2ps do if ! command -v $cmd >/dev/null then diff --git b/src/roff/groff/tests/smoke-test_html_device.sh a/src/roff/groff/tests/smoke-test_html_device.sh index 36dc50e47..9dbb8f298 100755 --- b/src/roff/groff/tests/smoke-test_html_device.sh +++ a/src/roff/groff/tests/smoke-test_html_device.sh @@ -22,7 +22,7 @@ groff="${abs_top_builddir:-.}/test-groff" # Keep this list of programs in sync with GROFF_CHECK_GROHTML_PROGRAMS # in m4/groff.m4. -for cmd in pnmcrop pnmcut pnmtopng pnmtops psselect +for cmd in pnmcrop pnmcut pnmtopng pnmtops ps2ps do if ! command -v $cmd >/dev/null then