OSIFY

View Pdf on WordPress Post / Page using google doc viewer

Very nice, let share you guys what I found and so interesting tips: to display your pdf on page or post, here is the way:

1. Add following function into functions.php of your theme:

/**
* Pdf viewer function
*/
function pdfviewer($attr, $content) {
return '<iframe src="http://docs.google.com/viewer?url=' . $attr['href'] . '&embedded=true" width="500" height="370" style="border: none;"></iframe>';
}
add_shortcode('pdfviewer', 'pdfviewer');

2. Usage in any post or page use as:

["pdfviewer" href="your-pdf-url" ]


(With no quote with word: “pdfviewer” ==> pdfviewer only)

See demo at: http://osify.com/2012/05/maths-binomial-probability-law/