Skip to content

Implicitcly create pdf hardcopy files #1096

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rmkaplan opened this issue Mar 7, 2023 · 7 comments
Open

Implicitcly create pdf hardcopy files #1096

rmkaplan opened this issue Mar 7, 2023 · 7 comments
Labels
duplicate This issue or pull request already exists

Comments

@rmkaplan
Copy link
Contributor

rmkaplan commented Mar 7, 2023

We don't have direct code for producing pdf files that can be viewed locally, relying on Preview or Acrobat reader to implicitly convert ps to pdf. Those programs no longer do the conversion on the Mac, so those files are now not easily viewable by non hackers.

Eventually it would be good to construct a pdf hardcopy-stream, but an interim solution is to make pdf be a wrapper on the postscript stream with a shell command to implicitly invoke an available converter so that the file shows up as pdf.

In the meeting today we noted that on the Mac there is a choice of pstopdf and ps2pdf. The former appears to be provided by Apple and is available on really stripped down systems (like my wife's). ps2pdf (ghostscript) may be better maintained, but it doesn't exist on all systems (e.g. not my wife's). I don't know what is available on Windows/Linux systems.

For starters I propose to implement a pdf wrapper that with a parameterized call out, with pstopdf built in for the Mac

@fghalasz
Copy link
Member

fghalasz commented Mar 8, 2023

There is no out-of-the-box ps viewer/converter delivered on most (if not all) Linux distros. You need to install the ghostscript package, which will install pd2pdf (along with gsview and a bunch of other stuff).

I can add the ghostscript package to install automatically in the .deb distribution files. But we will just have to add instructions to manually install ghostscript for anyone installing via .tgz files.

The Windows situation re: ps is irrelevant to us since we don't actually run on Windows per se - we run on top of either WSL or Linux running within a Docker container. Either way, what you want to do will be covered by installing ghostscript in the relevant environment.

Bottom line: on Linux use ps2pdf if it is there and error out otherwise.

@rmkaplan
Copy link
Contributor Author

rmkaplan commented Mar 8, 2023 via email

@nbriggs
Copy link
Contributor

nbriggs commented Mar 8, 2023

The Ubuntu distro I installed (22.04) seems to have ghostscript already installed, and thus had ps2pdf.

@fghalasz
Copy link
Member

fghalasz commented Mar 8, 2023

Interesting. Ubuntu 22.04 on WSL does not come with ghostscript installed.

Is your version the Ubuntu 22.04 Desktop directly from Canonical?

@nbriggs
Copy link
Contributor

nbriggs commented Mar 8, 2023

@fghalasz - yes, ubuntu-22.04.1-desktop-amd64.iso

@masinter
Copy link
Member

masinter commented Apr 8, 2023

Consider https://github.com/mbattyani/cl-pdf
A Common Lisp PDF writer with a suitable license. Old, but more likely to be compatible.
One level of Common Lisp compatibility is "Can we run Common Lisp code from other sources".

@masinter masinter added the duplicate This issue or pull request already exists label Apr 22, 2023
@masinter
Copy link
Member

First raised in #363

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
Status: No status
Development

No branches or pull requests

4 participants