WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to insert a Pdf visualizer to read my wp articles. So I can print go through pages like the one in www.scribd.com Is there any plugin for that? I tried "Google Doc Embedder" plugin but I couldn't make it work..

Thanks for your help!

share|improve this question

You can put this in your theme functions.php file, It will work in any browser ( I tested this since it uses an iframe) and auto embed .pdf files from the media tab when you click "insert into post".

You can alter the width and height parameters for the size when its added to the editor.

add_filter('media_send_to_editor', 'my_filter_pdf', 20, 3);

function my_filter_pdf($html, $id) {
    $attachment = get_post($id); //fetching attachment by $id passed through

    $mime_type = $attachment->post_mime_type; //getting the mime-type
    if ($mime_type == 'application/pdf') { //checking mime-type
        $src = wp_get_attachment_url( $id );

        $html = '<iframe width="500" height="500" src="'.$src.'"></iframe>';
        return $html; // return new $html    
        return $html;

I made a plugin version here for you, create a php folder and inside that a .php file in your WordPress /plugins folder and paste this into it. https://gist.github.com/2176359

share|improve this answer
Please return something in cases where your if statement returns false. – toscho Dec 16 '12 at 13:52
I guess that would be important! – Wyck Dec 16 '12 at 17:17

here's a pdf viewer based on html5 and js which firefox added to its extensions :


and here's a demo of it :


but I don't know how you make your articles into pdf's.

share|improve this answer

You could find out what isn't making the Google Doc Embedder plugin work for you. As the developer of that plugin, I can hopefully provide some support to whatever issue you're having...


share|improve this answer

Use the plugin specific for embedding PDFs.

And don't forget to accept one of the answers given to you.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.