Embed PDF into wordpress

The only reliable cross browser solution is to embed the .pdf in a iframe.

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

function my_pdf_embed($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 );

        //change the size to your liking
        $html="<iframe width="500" height="500" src="".$src.'"></iframe>';
        return $html; // return new $html    
    }
        return $html;
}

tech