Hi R Group
Thanks for some suggestions.
I have finally figured it out..
The following script called from within R Session does what i want..(to
attach files called test1.pdf and Document-1.pdf into the file test2.pdf and
then save the new file with attachments as test3.pdf at the given path)

options(useFancyQuotes=FALSE)
system(noquote(paste("pdftools
-S",dQuote(paste("attachfiles=C:\\test1.pdf|C:\\Document-1.pdf")),
paste("-i C:\\test2.pdf -o C:\\test3.pdf"))))
Regards
Vijayan Padmanabhan
On Sun, Apr 3, 2011 at 5:21 PM, Mike Marchywka <marchy...@hotmail.com>wrote:

>
>
>
> > Date: Sun, 3 Apr 2011 01:35:16 +0530
> > From: nandan.a...@gmail.com
> > To: padmanabhan.vija...@gmail.com
> > CC: r-help@r-project.org
> > Subject: Re: [R] help
> >
> > One way that u might have thought of is to create plot in PDF in R and
> the
> > use pdftools.
> > Additionally one can also think of running R script using R CMD and then
> > using pdftools in a .sh script file if u r in linux.
> > I am not aware of pdftools capability in R.
> >
> > On 2 April 2011 23:01, Vijayan Padmanabhan wrote:
> >
> > > Dear R Help group
> > > I need to run a command line script from within R session. I am not
> clear
> > > how i can acheive this. I tried shell and system function, but i am
> missing
> > > something critical.can someone provide help?
> > > My intention is to create a pdf file of a plot in R and then attach
> > > existing files from my system as attachment into the newly created pdf
> > > file.
> > > Any help would be greatly appreciated.. Here is the command line script
> i
> > > want to execute from within R.
> > >
> > >
> > > pdftools -S "attachfiles=C:\test1.pdf" -i C:\test2.pdf -o C:\test4.pdf
> > >
> > > Regards
> > > Vijayan Padmanabhan
>
>
> I just tried
>
> > system("pdftk --help")
>
> and it appeared to work as I have pdftk from cygwin.I routinely do this the
> other way however and invoke
> R from a bash script and then use external tools like this from the bash
> script
> after R is done. If I'm generating various pieces, it seems to make sense
> to get them all first and release any resources R has accumulated
> as pdf manipulation itself can often require lots of memory etc.
>
>
>
>
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to