Pdf's produced by MacVim's Print are not printable with Mac Preview

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Pdf's produced by MacVim's Print are not printable with Mac Preview

Peter Shenkin
(N.B. I know there is a vim-mac group, but my attempts to post to it are failing, though I am a member.)

Hi,

This is likely a Mac Preview bug, or perhaps an HP-CP1525nw bug, but I wanted to at least inquire here.

When I use MacVim's "Print" facility to print a file, MacVim creates a .pdf and opens it using the Mac's Preview program. If I then try to Print from Preview, the file gets queued to the printer but then never prints; it remains queued with the message "Printing – Waiting for job to complete" until, after a long time, it times out.

The MacVim-written .pdf can be saved. It can be printed from Acrobat Reader without problems.

There's an online tool at https://www.pdf-online.com/osa/validate.aspx that can be used to check .pdf syntax, and it gives the MacVim-written .pdf a clean bill of health.

Has anyone else encountered this problem, and is there a workaround, other than using Acrobat manually? For example, is there a way to get MacVim to use Acrobat Reader as its .pdf print app rather than Preview? Or is there a way to get MacVim to write Preview-compatible .pdf files?

I'm on MacOS Sierra, 10.12.6, with the latest patches.

Thanks,
-P.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Pdf's produced by MacVim's Print are not printable with Mac Preview

Lifepillar
On 07/09/2017 23:47, Peter Shenkin wrote:
  For example, is there a way to get MacVim to use Acrobat Reader as its
.pdf print app rather than Preview?

I have this snippet in my vimrc, which you may adapt:

   if has('mac')
     fun! PrintFile(fname)
       call system('pstopdf ' . a:fname)
       call system('open -a Preview ' . a:fname . '.pdf')
       call delete(a:fname)
       call delete(a:fname.'.pdf')
       return v:shell_error
     endf
     set printexpr=PrintFile(v:fname_in)
   endif

Enjoy,
Life.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Pdf's produced by MacVim's Print are not printable with Mac Preview

Stroller-2
In reply to this post by Peter Shenkin

> On 7 Sep 2017, at 22:47, Peter Shenkin <[hidden email]> wrote:
>
> When I use MacVim's "Print" facility to print a file, MacVim creates a .pdf and opens it using the Mac's Preview program. If I then try to Print from Preview, the file gets queued to the printer but then never prints; it remains queued with the message "Printing – Waiting for job to complete" until, after a long time, it times out.
>
> The MacVim-written .pdf can be saved. It can be printed from Acrobat Reader without problems.

Out of curiosity, can you save the PDF to a file, and then print it using Preview?

Stroller.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Pdf's produced by MacVim's Print are not printable with Mac Preview

Shawn H Corey
On Fri, 8 Sep 2017 10:46:46 +0100
Stroller <[hidden email]> wrote:

>
> > On 7 Sep 2017, at 22:47, Peter Shenkin <[hidden email]> wrote:
> >
> > When I use MacVim's "Print" facility to print a file, MacVim
> > creates a .pdf and opens it using the Mac's Preview program. If I
> > then try to Print from Preview, the file gets queued to the printer
> > but then never prints; it remains queued with the message "Printing
> > – Waiting for job to complete" until, after a long time, it times
> > out.
> >
> > The MacVim-written .pdf can be saved. It can be printed from
> > Acrobat Reader without problems.
>
> Out of curiosity, can you save the PDF to a file, and then print it
> using Preview?
>
> Stroller.
>

I'm running GNU-Linux and I installed the cups-pdf, which is a virtual
printer that prints files to PDF. Since CUPS was originally developed
by Apple, you should be able to download it.

cups-pdf http://www.cups-pdf.de/

CUPS https://www.cups.org/


--
Don't stop where the ink does.

        Shawn H Corey

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Pdf's produced by MacVim's Print are not printable with Mac Preview

Peter Shenkin
In reply to this post by Stroller-2
On Friday, September 8, 2017 at 6:01:33 AM UTC-4, Stroller wrote:
> Out of curiosity, can you save the PDF to a file, and then print it using Preview?

Hi,

No -- the same thing happens.

-P.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Pdf's produced by MacVim's Print are not printable with Mac Preview

Peter Shenkin
In reply to this post by Lifepillar
With this in my .vimrc, I get exactly the same behavior as before. (After closing and restarting vim, of course....)

-P.

On Friday, September 8, 2017 at 4:38:16 AM UTC-4, Lifepillar wrote:

>    if has('mac')
>      fun! PrintFile(fname)
>        call system('pstopdf ' . a:fname)
>        call system('open -a Preview ' . a:fname . '.pdf')
>        call delete(a:fname)
>        call delete(a:fname.'.pdf')
>        return v:shell_error
>      endf
>      set printexpr=PrintFile(v:fname_in)
>    endif
--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Pdf's produced by MacVim's Print are not printable with Mac Preview

Lifepillar
On 09/09/2017 19:14, Peter Shenkin wrote:
> With this in my .vimrc, I get exactly the same behavior as before. (After closing and restarting vim, of course....)

I have suggested my snippet as an answer to your request about
how to open a PDF with an app different from Preview.app.

If you want to use Acrobat, you need to replace `Preview'
with `Acrobat Reader' (o whatever the name of the app is) in
the snippet.

Life.

> On Friday, September 8, 2017 at 4:38:16 AM UTC-4, Lifepillar wrote:
>>     if has('mac')
>>       fun! PrintFile(fname)
>>         call system('pstopdf ' . a:fname)
>>         call system('open -a Preview ' . a:fname . '.pdf')
>>         call delete(a:fname)
>>         call delete(a:fname.'.pdf')
>>         return v:shell_error
>>       endf
>>       set printexpr=PrintFile(v:fname_in)
>>     endif
>


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.