LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-23-2021, 02:40 PM   #1
b1bb2
Member
 
Registered: Oct 2021
Posts: 90

Rep: Reputation: Disabled
ascii art to pdf


I have debian 11.0.0 (bullseye).

These two commands create ascii art file.
jp2a --output=jp2aout.txt imagein.jpeg;
asciiart imagein.jpeg > asciiartout.txt;

But I found that text format is not easily portable, diffrent people use diffrent text programs.

One solution is this command.
ansilove -o asciiart.PNG asciiartout.txt;

Are there other solutions? How to convert text to pdf?

Here are some packages I tried: abiword, calligrawords, simplyhtml, wordgrinder, wordgrinder-ncurses, golang-github-jung-kurt-gofpdf-dev, htmldoc, linuxdoc-tools-latex; page-crunch, pdfproctools, php-dompdf, pod2pdf, qpdf.
Sometimes the program breaks the text into pages.

On a minor side note, ansilove says File asciiartout.txt does not have a SAUCE record. I found documentation showing how to manually create a SAUCE record. Is there an automatic way? And does anyone even use it?
 
Old 10-23-2021, 02:50 PM   #2
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,678

Rep: Reputation: Disabled
Have you tried https://github.com/baruchel/txt2pdf? By default, it will break the output into pages as well, but you can specify --minimum-page-length as an option.

Last edited by shruggy; 10-23-2021 at 02:52 PM.
 
Old 10-23-2021, 04:18 PM   #3
b1bb2
Member
 
Registered: Oct 2021
Posts: 90

Original Poster
Rep: Reputation: Disabled
Thank you shruggy Senior Member.
I ran this code: git clone git://github.com/baruchel/txt2pdf
I got this file: txt2pdf/txt2pdf.py
I ran this code: python txt2pdf/txt2pdf.py --minimum-page-length 100 -o asciiart.pdf asciiart.txt
I got this file: asciiart.pdf
word wrap occurs, but I can play with the margin switch. It looks like this will do the job. I wonder why it is not in debian. Is there something in the debian repository that will work? I found other website https://sanface.com/txt2pdf.html that has propiatery txt2pdf for sale.
 
Old 10-23-2021, 05:29 PM   #4
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,678

Rep: Reputation: Disabled
Quote:
Originally Posted by b1bb2 View Post
Is there something in the debian repository that will work?
I guess some combination of Ghostscript options may work. Ghostscript comes with a PostScript utility gslp.ps (as well as a shell script /usr/bin/gslp that uses it). gslp.ps understands some switches of enscript including -L.

Alternatively, you can use enscript to convert the text file to PostScript, then convert the result to PDF.

Last edited by shruggy; 10-23-2021 at 05:40 PM.
 
  


Reply

Tags
pdf



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Google Wallpaper Art app turns your Chromebook into an art gallery LXer Syndicated Linux News 0 11-14-2015 08:54 AM
Drawing ASCII art vharishankar General 3 01-12-2006 02:51 AM
ASCII Art Program mattp Programming 2 03-15-2004 10:32 PM
traditional art vs modern art acid_kewpie General 14 10-27-2003 01:12 AM
lilo message - how to make a picture (not ASCII art)? Frustin Linux - Software 3 06-10-2002 03:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration