[poppler] Generating lovely pen plotter output from Poppler: Pull request

Oliver Sander oliver.sander at tu-dresden.de
Thu Dec 17 10:51:06 UTC 2020


Hi Jon,

thanks for reaching out---what you have sounds like an interesting project.

In order to get your code reviewed for inclusion into poppler you need to get
an account for the freedesktop/poppler GitLab instance:

   https://gitlab.freedesktop.org/poppler/poppler

Afterwards please open a merge request with your proposed changes.

Best regards,
Oliver

On 17.12.20 08:58, jonh.poppler at jonh.net wrote:
> Howdy team Poppler,
> 
> I've been on a decades-long quest for the best way to get cool output onto my 1985 HP 7585B pen plotter. There are dozens of tools for generating HPGL from various formats around the Internet, and they all stink. This tool is the HPGL conversion tool to end all HPGL conversion tools -- a motto that rolls off the tongue!
> 
> I'd greatly appreciate it if someone on the team could *guide me through getting these changes into Poppler*. Below i give a brief description of the changes, quick-start instructions to try it out, and specific requests for feedback and guidance.
> 
> Thank you!
> 
> 
> What's in the tin
> 
> Please find my branch here:
> 
> https://github.com/jonhnet/plotler <https://github.com/jonhnet/plotler>
> 
> It consists of:
> 
> * A first commit that refactors SplashOutputDev to put a part of its functionality into a weaker superclass VectorOutputDev. This is to prepare for code sharing without "subclass-by-deletion". This commit also exposes a couple of methods in SplashPath as public.  It also moves some supporting code that used to be in SplashOutputDev into a pair of new files VectorFonts and VectorDynamicPatters; just an overdue cleanup. (4dec008eddea2329c0e8277398803cb9022b15cc)
> 
> * Then the rest of plotler as new files: A new StrokeOutputDev that inherits from VectorOutputDev to capture stroke and drawChar commands and flatten them down to simple strokes. A new utils/plotler.cc CLI that invokes it. It relies on:
> 
> - Plot, PlotClip, and PlotEmit for manipulating pen paths.
> 
> - HersheyFont, HersheyDirectory, and HersheyUnicodeSubstitutions for manipulating Hershey fonts.
> 
> 
> Try it out
> 
> # standard poppler build
> git clone https://github.com/jonhnet/plotler <https://github.com/jonhnet/plotler>
> mkdir poppler-install
> cd plotler
> mkdir build; cd build;
> INSTALLDIR=`(cd ../../poppler-install; pwd)`
> cmake .. -DCMAKE_INSTALL_PREFIX=$INSTALLDIR -DCMAKE_BUILD_TYPE=debugfull
> make -j4
> make install
> 
> # and now try plotler
> ./utils/plotler -i ../test/plotler/brake-diagram.pdf -o proof.svg && eog proof.svg
> ./utils/plotler -i ../test/plotler/verikv-osdi2020-final.pdf -n 9 -o proof2.svg && eog proof2.svg
> 
> 
> Feedback requested
> 
> - Community code standards. Guidance welcome.
> 
> - I have written zero tests. Guidance on meeting appropriate standards would be helpful.
> 
> - My commit includes a bunch of PDF test files I used to guide development. Should these be removed or included in the proposed change?
> 
> - Utility name. Plotler maybe is too clever? I considered "pdftohpgl", but the thing can already emit SVG, and I could imagine growth to support more formats.
> 
> 
> Background
> 
> After finding other tools wanting, I wrote my own Python SVG->HPGL extension a decade ago. It sucked, because it required me to interpret so much of SVG. Then I thought, hey, I/nkscape/ knows how to interpret SVG! So I hacked a converter into inkscape 0.42 -- and it served me well for years, long after modern distros couldn't build that version of Inkscape. But it wasn't super flexible, and there was no reasonable way to share it. A couple years ago I thought, maybe it's time to try again with a general vector graphics engine designed for library access, so I sat down with Ghostscript. I aged three years that weekend.
> 
> It finally struck me that I should find a /modern/ vector graphics toolkit. And if I start with PDF, I'm basically building a printer driver. Poppler was the perfect fit -- nicely organized & modularized code, and already set up to build a set of conversion utilities, so plotler fits right in.
> 
> I think it would be fun to write a CUPS backend based on Plotler, so I can just click "Print" in any application and have it pop out on a pen plotter.
> 
> 
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/poppler
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5198 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://lists.freedesktop.org/archives/poppler/attachments/20201217/df3c3617/attachment.bin>


More information about the poppler mailing list