# Man; I wish I knew this many years ago

**URL:** <https://ifnotnil.com/t/man-i-wish-i-knew-this-many-years-ago/3147>\
**Category:** Show & Tell\
**Created:** [10 March 2023 18:32 UTC](https://ifnotnil.com/t/man-i-wish-i-knew-this-many-years-ago/3147 "2023-03-10T18:32:52Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![MarkFX](https://ifnotnil.com/letter_avatar_proxy/v4/letter/m/65b543/32.png) [@MarkFX](https://ifnotnil.com/u/MarkFX)\
**Post date:** [11 March 2023 18:26 UTC](https://ifnotnil.com/t/man-i-wish-i-knew-this-many-years-ago/3147/5 "2023-03-11T18:26:32Z")

</div>

@JeanYves you can use the ‘pstopdf’ command line tool to convert postScript format files to PDF’s.  
And then you can open the created PDF document with the ‘Preview.app’.

This is an example based on Normans script, but made as an AppleScript.

```auto
set toolName to "ls"
set manPDFPath to "/tmp/" & toolName & ".pdf"
set manPDFFile to do shell script ("man -t " & toolName & " | pstopdf -i -o " & manPDFPath)
delay (1.0)
set openManPDFFile to do shell script "open " & manPDFPath & " -a Preview"

```

Regards Mark

---

_[View the full topic](https://ifnotnil.com/t/man-i-wish-i-knew-this-many-years-ago/3147)._
