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 … Read more

wp_mail issue with sending PDF

Instead of attaching the attachments to body content. Pass it as separate parameter. Like the below one. @wp_mail($to, $subject, $msg, $headers,$mail_attachment); I guess it solves your problem.

Private pdf files

Your approach does not provide security. I could hand-craft a cookie named “wordpress_logged_in” (containing any arbitrary value) and have access to your PDF files. You may want to rethink your solution to put a PHP script in between the files and the users. e.g. User Clicks download button PHP Script handles fetching document If authenticated … Read more

Using a .pdf file as a page in wordpress

just upload it through ftp or your domain hosting panel to your public_html (www) directory. It will be there as a link to www.example.com/myfile.pdf. The case may be that if you have wordpress and installed any security plugins you’ll have to allow the exception within that plugin as well.

Post Title to link to a PDF

I recommend using the plugin Advanced Custom Fields (Very popular plugin). It lets you create fields and manage their values very easily. This way you could just create a new field for file upload and then to pull its information like this- <?php $my_file = get_field(‘my_file’); if( $my_file ) { echo $my_file[‘url’]; echo $my_file[‘alt’]; echo … Read more

Add pdf to a website

Your website speed totally depends on your server speed. If you have a lot of visitors that are going to open/use those PDF links, then you are going to have a large number of requests, of course. This might result in a slower speed on a shared hosting. The better way is to use a … Read more

Change meta data of pdf file

Google also pulls information from the PDF file itself. To truly fix the files, you’ll need Acrobat Pro. You can then edit the embedded title, and you then delete the original and upload a new one. If these PDFs are associated with specific Posts or Pages, it’s safest to go to that individual Post or … Read more