cups-filters
                                
                                
                                
                                    cups-filters copied to clipboard
                            
                            
                            
                        Support 'vnd.cups-banner' format to be converted by a 'x-bannertopdf' filter
After having poked a bit into what features the cups-filters bannerfile format application/vnd.cups-pdf-banner and the related bannertopdf filter currently provide, it appears to me that bannertopdf is not able to support the original banner file source format of CUPS itself (i.e. vnd.cups-banner as specified here: https://www.cups.org/doc/spec-banner.html).
While this banner file format is native to CUPS, still the CUPS source code does not provide any filter to convert it to PDF for all platforms -- there is only cgbannertopdf filter for macOS (and cgbannertopdf is not open source).
I do not see any major technical reason why cups-filters should be limiting itself like this, and why there wouldn't be a way to directly support the original application/vnd.cups-banner format.
Upon further reading, I do not really understand why this current bannertopdf filter business in the CUPS-filters project takes such a complicated route.
Why for heaven's sake are we going to manipulate PDF forms ??
AFAIR, forms are one of the least supported and understood aspects of the PDF file format in the Open Source universe. Many open viewers do not even display them properly, most PDF-generating applications do not know how to create them ( -- even though users have complained for a long time about missing PDF form support).
It's well possible that I do not understand the issues at play here. If so, please do kindly expain them to me so I'm enlightened.
IMHO, there is no need to mess with PDF forms. Just take the variables and values defined in the banner file, create a Markdown or HTML text from them and then convert that Markdown to a PDF. For that conversion, any of multiple available command line tools could be empoyed. Yes, this would be an additional dependency -- but I do not care at this moment. I want bannerfiles to be properly supported!
The banner page does not need to be super-fancy, it has to be functional.
Heck, I mean I could even write a relatively simple shell script wrapper around any selection of third party command line tools (like pdftk, enscript, a2ps, htmldoc or pandoc) to dynamically generate a PDF page out of a #PDF-banner or a #CUPS-banner text file...
Not being a "proper" programmer, but only an amateur shell scripter, there must clearly be something I'm heavily missing. Can somebody please tell me, what?
So I created a proof-of-concept 'bannertopdf' filter, based on a shell script. This script creates as an intermediary file HTML, and then currently two different PDFs: one with the help of Pandoc, the other with the help of HTMLdoc. Took about 2,5 hrs on Github:
- https://github.com/KurtPfeifle/kp-bannertopdf