Thanks Jens and Jerry, I was not aware of this program (sips) and it
generates nice bitmaps indeed, and quite quickly in comparison with the
gs+convert solution that was rather slow on my macbook air.

The version I use is the following (adapted for the 128dpi display of my
MBA):

sips  -s dpiHeight 128.0 -s dpiWidth 128.0 --resampleWidth 600
--setProperty format png $$i --out $$o


2013/12/4 Jerry <[email protected]>

>
> On Dec 3, 2013, at 6:44 PM, Jens Nöckel <[email protected]> wrote:
>
> >
> > On Dec 3, 2013, at 2:14 PM, Jerry wrote:
> >
> >>
> >> On Dec 3, 2013, at 1:53 PM, Stephen Buonopane <[email protected]>
> wrote:
> >>
> >>> Try the solution given here…
> >>> http://michael.orlitzky.com/articles/fixing_pdf_graphics_in_lyx.php
> >>> which creates a direct conversion from pdf to png.
> >>>
> >>> It solved a related problem for me in the past where the conversion
> through eps subtly changed the graphics dimensions making on screen
> cropping near impossible.
> >>
> >> Thanks, Stephen! That has fixed the problem.
> >>
> >> There remain some unanswered questions. It looks like the converter
> pdftops is broken, at least on my machine. Your fix bypassed it, and
> elsewhere in this thread I reported that a manual conversion created an EPS
> file that was invalid. Is this a known problem?
> >>
> >> Since PDF is truly a native file format on OS X, it seems that your fix
> should be incorporated into LyX permanently because OS X users are trying
> to paste PDFs into LyX very frequently. Have you suggested this fix to the
> developers?
> >>
> >> Jerry
> >
> >
> > As an alternative to Stephen's suggestion, you could also add the
> following converter for PDF to PNG. In my preferences, I chose the "From
> format" as
> >
> > PDF (ps2pdf)
> >
> > and entered this code for "Converter":
> >
> > sips -s format png $$i --out $$o
> >
> > This uses the OS X built-in command sips instead of Ghostscript.
>
> Thanks for that tip, Jens. I really like the idea of using OS X's built-in
> image processing. However, this command scales the image by 200% so I added
> an option to scale to a width of 560 pixels which seems comfortable for me,
> and preserves the aspect ratio. (I know that I could use LyX to scale the
> on-screen size manually but this is laborious and makes the image ugly.)
>
> In addition, there is a pink background behind the image which I don't
> like and which the GhostScript-and-convert command suggested earlier in the
> thread does not do. This is fixed by Preferences -> Look and Feel -> Colors
> -> graphics background to white, but that leaves the question of why the
> GhostSript approach did not result in a pink background--I'l bet it did not
> render the PDF with a solid background but left it transparent. This
> (putting a solid background) can be an issue which causes the image to
> appear bigger than it is and can cause centering problems in the output
> PDF, but I'll leave that to solve another day.
>
> So for the record, the sips command I'm using is:
>
> sips --resampleWidth 560 --setProperty format png $$i --out $$o
>
> Again, thanks.
>
> Jerry




-- 
Prof. Murat Yildizoglu

Université Montesquieu Bordeaux IV
GREThA (UMR CNRS 5113)
Avenue Léon Duguit
33608 Pessac cedex
France

Bureau : E-331

mail: yildi-at-u-bordeaux4.fr

web: yildizoglu.info

Reply via email to