Home   Research   Resource   About us   Sitemap   
R Packages
 Funmap Package
 EIP Package
 R/fGWAS Package
 HaruPDF Package
 3FunMap Software
 fGWAS Software

Home>>Resource >> Software

HaruPDF: Compressible PDF library for R


The HaruPDF is an extension to PDF or postscript function in R.

The pdf() function can't write compressed images into PDF file, but HaruPDF can do that. Based on the libharu library, the package provides two functions, drawPng() and drawJpeg(). They can draw PNG or JPEG images into PDF directly and save images in compress way.

It not only enhances image embedment, but also provides outline(or bookmark) function for PDF document. addOutline() makes PDF document more readable and useable.

For more details, please refer to the help page.


The package is only available for Windows.

The source code also can be downloaded by the following link.

So far no document is available. Please refer to the following help link.


So far HaruPDF only provides windows platform. In windows platform, it is very easy to install. After you download this package file, please type the following command or click the menu item "Install packages from local zip files".

Windows OS:

>install.packages("x:/fullpath/harupdf_2.12.0.zip", repos=NULL)

Before the package is used in R, the package importation is necessary by the following command:

> library(harupdf)

After it is loaded, all functions within HaruPDF library will be readily available to the user.

Sample Script:

The following source shows how to call the main function in R.

harupdf(file = "haru_demo.pdf", paper="letter", width=7, height=9.5);

plot(1, 1, type="n", xlim=c(0, 7*254), ylim=c(0, 9.5*254),
       xlab="", ylab="", lwd=2, xaxt="n", yaxt="n");

text(7*254/2, 1600, "HaruPDF report", cex=2, adj=0.5);
addOutline(".", "X", "HaruPDF");
addOutline("X", "C0", "Cover");

#page 1
plot(100:800, 100:800, type="l", xlim=c(-5, +1500), ylim=c(-100, +1000), col="blue",
     lwd=0.25 );
addOutline("X", "C1", "JPEG & line");

#page 2
addOutline("X", "C2", "ND data");


Sample PDF:

PDF file

Last updated:

Version 2.12.0 01/11/2011

Copyright© 2009-, Center for Statistical Genetics, Penn State University, All Rights Reserved.