Skip to content

Should gv be able to read bitmap(... type= "pdfwrite") ?

4 messages · Michael A. Miller, Peter Dalgaard, John Williams +1 more

#
> Hi there folks I have R 1.3.0 running on Red Hat Linux 7.1
    > with GhostView 3.5.8.  When I produce a file like:

    >> bitmap("foo.pdf", type="pdfwrite") 
    >> plot(foo) 
    >> dev.off()

    > and then try to read it with gv, I get an unrecoverable
    > error and nothing displayed.

That works for me (R 1.3.0-1, Debian testing, gs 5.10-10.1, gv
3.5.8). 

On a related note, when using type="pdfwrite", bitmap doesn't
actually produce bit mapped graphics.  For vector graphics I
normally use the postscript device, and more recently, the pdf
device, as in

    > postscript("foo.ps"); plot(foo); dev.off()

and 

    > pdf("foo2.pdf"); plot(foo); dev.off()

I have noticed that bitmap("foo.pdf", type="pdfwrite") produces
different results than pdf("foo2.pdf") does: bitmap(...) uses
ghostscript and makes version 1.2 pdf which pdf(...) doesn't use
ghostscript and makes version 1.1 pdf.  The practical consequence
of this seems to be that the v1.2 pdf file is smaller and that
the v1.2 pdf file has text labels that are more similar to what I
see on my screen (but still somewhat larger than on screen, the
v1.1 text is much larger).  The postscript device produces files
that have text that looks very close to what I see on screen.

Mike
#
mmiller3 at iupui.edu (Michael A. Miller) writes:
The latter bit doesn't look like a PDF version issue to me. Rather an
issue of pointsizes relative to display area.

bitmap() defaults "pointsize=" to 1.5 * min(width, height) which at
6in x 6in comes out as 9pt, whereas pdf() uses that from
.PostScript.Options which is generally 12pt, also on 6x6. postscript()
also uses 12pt, but on a bigger page (papersize minus 0.5in for the
margins). x11() also uses 12pt, size 7x7.

Hmm. This might need some sanitizing at some point...
#
Hi there folks

I have R 1.3.0 running on Red Hat Linux 7.1 with GhostView 3.5.8.  When
I produce a file like:
and then try to read it with gv, I get an unrecoverable error and
nothing displayed.

Any help as to whether this ***should*** work would be appreciated.

cheers,

John
4 days later
#
On 11 Jul 2001, Michael A. Miller wrote:

            
(It uses flate compression: pdf uses none.  There is a good reason for
that: all including applications can compress the final file, and
compressing the intermediates is only a minor space saving.)
(That's related to the defaults for width, height and pointsize.  You
can alter any of them to get what you want ....)