Creating PDF using PHPExcel - phpexcel

I am using PHPExcel to generate PDF files with mPDF as the rendering engine.
The output is a table.Is there any way I can output a page title to the pdf file?
Thanks for any help
Simmy

I would suggest against using PHPExcel for this task, go with dompdf instead, its much more robust and flexible in terms of styling.
Look into this PHPExcel object:
$objPageSetup = new PHPExcel_Worksheet_PageSetup()
It seems to setup some of the object properties and according to this post , some of them work for PDF

Related

Atom: viewing a pdf

My pdf looks like:
How do I make it show the actual pdf?
I loaded pdf-view from https://atom.io/packages/pdf-view and now when I open a pdf file i get it shown onscreen as a it's meant to be displayed. There is also a package named pdf-view-Plus which claims to be better than pdf-view. Just load the package and you should be ready to go.
Atom on his own cant read the PDF document as it is a binary file, in order to view the formatted document you must use a Atom package like https://atom.io/packages/pdf-view
You would need to install some other extension as Atom can't read PDFs on it's own. You could use something such as https://atom.io/packages/pdf-view.

Inserting images in R markdown using a path variable

I am new to R and Rmd and trying to generate a report using Rmd. This report has several images inserted along with the text. I am able to insert an image by hardcoding the path of the image. I have no problems with that but I need the path as a variable because it varies with the project. Can anyone help me with the syntax for calling a variable within a path to the image?
![Relatedness check](/data/array_processing/in_progress/Project123/files/data/plots/Project123.ibd.png)
"Project123" changes based on the project. Is there a way I can declare this variable and call it to define the path?
Help please.
Images can use online R code for dynamic paths and/or alt text. (Early adopters of rmarkdown often tried this method as the default method of including R plots in the reports, using png(filepath...); plot(...); dev.off() followed by what I recommend you use.)
This will allow you to do what you need:
![something meaningful](`r filepath`)
as raw markdown (and not inside a traditional code chunk).
If you aren't familiar with inline code blocks, then know that you can put just about anything in an inline code block. This is handy for including dynamic content in a paragraph of text, for example "the variance of the sample is \r var(sample(99))``". (Often it is just a pre-created variable, if numeric it is often rounded or formated to control the display of significant figures.)

Rmarkdown: Is there a function to create .Rmd documents?

When using Rstudio, one can use File -> New File -> R markdown... to create a new R markdown file from a template, with YAML headers and some examples already buffered. Is there a function to replicate this without an IDE (in this case, saving the template Rstudio would buffer in a new file)?
I'd rather start my .Rmd file from template rather than from scratch, but not using an IDE.
rmarkdown::draft seems to do what you want. It creates a new file, based on a template. You can provide a link to a custom template. See the help page for details.

How to access R markdown stored in a package

I want to create a package that produces reports using knitr that uses predefined templates.
At the moment I have a project directory that has this structure
R/createReport.r
R/reportTemplate.rmd
inside createReport.r I want to be able do something like the following;
require(knitr)
render('reportTemplate.rmd', output.file='someplace')
However I have no idea how to get the render function to locate my template file. Any help greatly appreciated!
You could store the template in yourpackage/inst/templates/sometemplate.Rmd and then access it with:
system.file("templates/sometemplate.Rmd", package="yourpackage")

how to embed images (data URI scheme) using .rhml files and knitr?

When converting markdown to html the default is (I think) to convert an image file into a string and embed it into the html file. When running knit on an rhtml file this is not the case though. Here a separate figure folder is generated, which is of course a sensible default setting.
But if I want my images to be embedded, is there a way to achieve this using rthml and knitr as well? I can't find any options where to declare this.
Thanks, Mark
Alright, I figured out myself. Seems to work just the same as with .Rmd files, by simply passing the string "base64_images"to the options argument in knit2html.
knit2html("foo.Rhtml", options=c("base64_images"))

Resources