From
Codefenix@VERT/CONCHAOS to
paulie420 on Thu Feb 9 09:12:32 2023
Re: Re: Sixel Gallery - Viewaã By: paulie420 to Codefenix on Wed Feb 08 2023 08:48 pmããHey Paulie :)ãã pa> VERY nice, Code - I also had this 'idea' for .PDFs... one could quicklyã pa> use a sixel converter to turn a PDF into a .six and display to the user.ããPDF to image conversion is a bit of a rabbit hole, considering it's a multi-page document format and can contain mixed media (text and/or images).ããAt work I use GhostScript to take PDF documents and convert each page to a separate TIF image, which gets stored in our document management software. That part's easy enough, as GS has command line options for that use case.ããSo, in theory, you could use GS to convert your source PDF to as many images as it has pages, and then convert those resulting images to sixel with ImageMagick, and display them. These conversion steps could take some time to complete if you plan on doing them on-the-fly.ããHere's where it gets hairy...ããIn my case I need to make my TIF output black and white, because GS' color output options usually end up generating ENORMOUS image files. It can output to PNG and JPG as well, but there's still the issue of file size. If you're only storing the image files temporarily, maybe it's not a problem, but still something to think about.ããThe other consideration is text quality/legibility. By converting PDF text to an image, the text won't look as sharp. By further converting it to sixel, it could look worse, especially if ImageMagick is scaling down the sixel for viewing in a typical 80x24 SyncTERM window. Maybe this isn't an issue if your source PDF is primarily image-based. But if it's text-based (but not a scanned image of text), you might consider using a tool like Poppler's pdftotext to extract the text from the PDF and display that as an alternative.ãã|01<|09co|03d|11e|15Ÿ|11e|03n|09ix|01>|07ã---ã þ Synchronet þ -=[ ConstructiveChaos BBS | conchaos.synchro.net ]=-ã