If in Sumatra I open text-based PDF file (i.e. file where I can select text and search for text), and print it to a PDF printer, thus producing another PDF, the new PDF is graphics-only, i.e. the contents become one big graphics. I wonder if this is expected, and if there are any settings or command-line options affecting this.
I understand that there may be questions why printing already-existing PDF to yet another PDF, but there are some scenarios when this is needed.
Home / Printing PDF to PDF printer produces As Image-only PDF
SumatraPDF 3.1+ is based on MuPDF 1.19+ (which unlike GS 9.55+) is designed for screen not printer.
Yes SumatraPDF is great for converting non searchable images and non searchable pdf to PAI (screen format image printing) and many users use it to “flatten” PDF to remove searching. But after version 3.0 (available from old downloads area) the many vector format commands needed for vector file printing were dropped as results were highly erratic (and sometimes still even for image prints).
If you use GS PDL for viewing PostScript and PCL (Printer Control Language) files within SumatraPDF you can script that to handle pdf2pdf file printing using ExternalViewers (Unfortunately edge2pdf is tough, but not impossible to do some limited conversion scripting)