Re: Is there any way to print attachments such as PDF files?

2021-05-03 Thread Andy Spiegl
> application/pdf; pdftotext --text %s; copiousoutput;

I prefer this actually:

---
application/pdf; pdftotext -layout -nopgbrk -q '%s' - ; copiousoutput; 
description=PDF; nametemplate=%s.pdf
application/x-pdf; pdftotext -layout -nopgbrk -q '%s' - ; copiousoutput; 
description=PDF; nametemplate=%s.pdf
---

Thanks,
 Andy


-- 
 Maintenance-free:  When it breaks, it can't be fixed...


Re: Is there any way to print attachments such as PDF files?

2021-04-30 Thread D.J.J. Ring, Jr.
For command line users, there is pdftotext available.
https://www.tutorialspoint.com/unix_commands/pdftotext.htm
A suitable entry in mailcap would enable its use.

## Plain text
text/plain; gedit %s; test=RunningX;
text/plain; nano %s;
#
## Images
image/bmp; fbi %s;
image/gif; fbi %s;
image/jpeg; fbi %s;
image/png; fbi %s;
image/tiff; fbi %s;
image/webp; fbi %s;
#
## Formatted Documents
application/msword; antiword -f %s; copiousoutput;
application/vnd.openxmlformats-officedocument.wordprocessingml.document;
docx2txt.sh %s; copiousoutput;
application/rtf; unrtf --text %s; copiousoutput;
application/pdf; pdftotext --text %s; copiousoutput;

David


Re: Is there any way to print attachments such as PDF files?

2021-04-19 Thread Mark H. Wood
On Fri, Apr 16, 2021 at 01:02:39PM -0600, Paul Gilmartin via Mutt-users wrote:
> On 2021-04-16, at 12:28:17, Chris Green wrote:
> > 
> > As per subject, is there any easy way to print attachments such as PDF
> > files?  Hitting 'p' against an attachment just says "I don't know how
> > to print that".  Is there any way to tell mutt how to print it which
> > will also allow printing of plain text as normal.
> >  
> Can mailcap entries handle that, or is mailcap solely for viewing?
> Is there a PDF viewer with a Print command?

From my ~/.mailcap:

application/pdf; \
/usr/bin/atril %s; \
description=Portable Document Format document; \
test=test $DISPLAY; \
nametemplate=%s.pdf; \
print=/usr/bin/lpr %s;

-- 
Mark H. Wood
Lead Technology Analyst

University Library
Indiana University - Purdue University Indianapolis
755 W. Michigan Street
Indianapolis, IN 46202
317-274-0749
www.ulib.iupui.edu


signature.asc
Description: PGP signature


Re: Is there any way to print attachments such as PDF files?

2021-04-16 Thread Paul Gilmartin via Mutt-users
On 2021-04-16, at 12:28:17, Chris Green wrote:
> 
> As per subject, is there any easy way to print attachments such as PDF
> files?  Hitting 'p' against an attachment just says "I don't know how
> to print that".  Is there any way to tell mutt how to print it which
> will also allow printing of plain text as normal.
>  
Can mailcap entries handle that, or is mailcap solely for viewing?
Is there a PDF viewer with a Print command?

-- gil



Re: Is there any way to print attachments such as PDF files?

2021-04-16 Thread Chris Green
On Fri, Apr 16, 2021 at 09:07:39PM +0200, Anders Damsgaard wrote:
> * Chris Green  [2021-04-16 19:28:17 +0100]:
> 
> > As per subject, is there any easy way to print attachments such as PDF
> > files?  Hitting 'p' against an attachment just says "I don't know how
> > to print that".  Is there any way to tell mutt how to print it which
> > will also allow printing of plain text as normal.
> > 
> Hi Chris,
> 
> Just pipe the file to 'lpr -P PDF'.  Optionally, add a keybind to do so.
> If you want to get fancy, you can make a shell script which detects the
> mime type, e.g. using `file -ib`, and takes action accordingly.
> 
Of course, obvious really, thank you.

-- 
Chris Green