[R] Inserting an image into a PDF file

2 views
Skip to first unread message

Dennis Fisher

unread,
Jul 11, 2010, 11:06:00 AM7/11/10
to r-h...@stat.math.ethz.ch
Colleagues,

I am creating a PDF document from R using pdf(), the document contains text / images created with R. I also have an image in either PDF / TIFF / JPEG format (in this case, a scanned image saved as a file).

I would like to insert the image into the PDF file. Any ideas on how to accomplish this?

(OS X, R 2.11.1)

Dennis


Dennis Fisher MD
P < (The "P Less Than" Company)
Phone: 1-866-PLessThan (1-866-753-7784)
Fax: 1-866-PLessThan (1-866-753-7784)
www.PLessThan.com

______________________________________________
R-h...@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

David Winsemius

unread,
Jul 11, 2010, 11:51:51 AM7/11/10
to Dennis Fisher, r-h...@stat.math.ethz.ch

On Jul 11, 2010, at 11:06 AM, Dennis Fisher wrote:

> Colleagues,
>
> I am creating a PDF document from R using pdf(), the document
> contains text / images created with R. I also have an image in
> either PDF / TIFF / JPEG format (in this case, a scanned image saved
> as a file).
>
> I would like to insert the image into the PDF file. Any ideas on
> how to accomplish this?

http://www.stat.auckland.ac.nz/~paul/Talks/import.pdf

>
> (OS X, R 2.11.1)
--

David Winsemius, MD
West Hartford, CT

Marc Schwartz

unread,
Jul 11, 2010, 12:33:56 PM7/11/10
to David Winsemius, Dennis Fisher, r-h...@stat.math.ethz.ch
On Jul 11, 2010, at 10:51 AM, David Winsemius wrote:

>
> On Jul 11, 2010, at 11:06 AM, Dennis Fisher wrote:
>
>> Colleagues,
>>
>> I am creating a PDF document from R using pdf(), the document contains text / images created with R. I also have an image in either PDF / TIFF / JPEG format (in this case, a scanned image saved as a file).
>>
>> I would like to insert the image into the PDF file. Any ideas on how to accomplish this?
>
> http://www.stat.auckland.ac.nz/~paul/Talks/import.pdf
>
>>
>> (OS X, R 2.11.1)

Just to offer an additional option since Dennis is on OSX, if you are on 10.6.x (Snow Leopard), you can view this YouTube video:

http://www.youtube.com/watch?v=zF_WgXAfMP0

which describes how to combine/insert pages from multiple document types that OSX' Preview can open.

If you are on Leopard (10.5.x), the drag and drop behavior, as noted in the above video, is somewhat different and you may wish to view this page:

http://macintoshhowto.com/leopard/how-to-merge-pdf-files-with-preview-in-leopard.html

This presumes that you want the scanned image on a separate page, rather than combined on the same page as your pdf() output. Since PDF is a native format on OSX, you can take advantage of built-in functionality to manipulate these files.

Of course using Sweave is yet another option.

HTH,

Marc Schwartz

Reply all
Reply to author
Forward
0 new messages