I have a gift voucher plugin for wordpress that creates a PDF after a user has finished filling in a form and sends it to the users email. This plugin uses the fpdf library to create the pdf. It worked fine before my web hotel installed OpenSSL/1.0.2g. Now I think that the SSL certificate blocks the pdf creation. I'm getting the following error message: PHP Warning: fopen(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed …
I am currently implementing a pdf export functionality within a wordpress plugin i'm developing but the pdf file generated when i click on export button is empty. To implement the export i use FPDF library Ive put the code which uses FPDF in a function which is executed by the wp_ajax_ action hook. Here is the code: <?php require_once plugin_dir_path( __FILE__ ) . 'fpdf/fpdf.php'; function pdf_pull_wpse_212972() { $pdf = new FPDF('p','mm','a4'); $pdf->SetFont('arial','b',14); $pdf->AddPage(); $pdf->Cell(40,10,'Referrer URL',1,0,'C'); $pdf->Cell(40,10,'User IP Address',1,0,'C'); $pdf->Cell(40,10,'User Agent',1,0,'C'); …
We are trying to display a cf7 form on woocommerce product pages, where users can submit the form and receive a pdf file related to the product (either as an email file attachment, as a link in the email body or even as a link that opens in a new browser tab). So far we have tried adding the pdf link as a product attribute and returning it with a shortcode, but... shortcodes don't work on CF7 e-mails. Does any …
I'm using a gift card plugin for my woocommerce shop and I would like to add a generated pdf file to allow customers to download the gift card as a pdf. The idea is to use TCpdf or Fpdf to generate the pdf and output it as a string. // Close and output PDF document // This method has several options, check the source code documentation for more information. echo $pdf->Output('S'); The problem is to get this file as an …
I have a medical client and they want to upload and post pdf automatically. So I stumbled upon frontend uploader, which allows users to upload and post an image to a blog post. It does however post with a pdf, but it goes straight to the media library. So a alternative solution I came up with is getting the pdf to jpeg, and then just upload the jpeg along with the blog post.
My client wants a PDF to be linked from a page with a different link structure. Currently I have it set up so the path to the document is this site.com/wp-content/uploads/date/PDF.pdf What they want is site.com/specificpage/PDF.pdf Could anyone provide any help on this? Thanks, Ben
I need help with a search page. We are a circuit court and use the latest version of WordPress for our website (flcourts18.org). We want the public to be able to search our administrative orders, which are all pdf's only from a specific folder where only the admin orders are stored. How do I setup a search page that will only search the pdf's from within a single folder? There are hundred of pdf's. We would like to search by …
I am using Advanced Custom Fields plugin(free version) for attaching 3 different pdf files to a single post. After displaying a list of posts on a template, with a button click I am making an AJAX Request to get the files of all displayed posts. Since every post has 3 PDF files, I want to merge all these files of all posts to a single PDF file and download that single file. What I did so far : AJAX Request …
I have installed all the required extensions like ImageMagick, Imagick, and Ghostscript. I used a plugin to test the requirements and everything passed. ImageMagick: Installed Imagick: Installed Ghostscript: Installed WordPress >= 4.7: Installed GPL Ghostscript 9.27 (2019-04-04) But for some reason, WordPress does not generate thumbnails for PDF files while uploading them directly from the media manager or from the post editor. I also tried using the Regenerate Thumbnails plugin but it did not scan for the PDF file. I …
I have an attachment page for post images, so that when I click on the thumbnail (on the front end) it takes the user to the attachment page for that image, how would I do the same for pdf files, so that when I click on the direct link to the pdf on the front end to redirects to the pdf attachment page? <?php if ( wp_attachment_is_image( $post->id ) ) : $att_image = wp_get_attachment_image_src( $post->id, "full"); ?> <center> <p class="full-attachment"> …
I have a website containing details of certificates and I want to create pdf files for each certificate using the id. The process I want is: The user enters the id of the certificate and a page should load a pdf file (from the given template). Is there any plugin or other way to accomplish this?
I have a custom plugin that creates an input field under each post, that allows users to upload PDF files. $html .= '<input accept="application/pdf" type="file" id="wp_custom_attachment" name="wp_custom_attachment" value="" size="25">'; I am using wp_upload_bits and wp_insert_attachment to upload the file: if(!empty($_FILES)) { if ( !empty($_FILES['wp_custom_attachment']['name'])) { $uploaded_anexa = wp_upload_bits($_FILES['wp_custom_attachment']['name'], null, file_get_contents($_FILES['wp_custom_attachment']['tmp_name'])); $uploaded_anexa_location = trailingslashit ( $wp_upload_dir['path'] ) . $_FILES['wp_custom_attachment']['name']; $attachment_anexa = array( guid' => trailingslashit ($wp_upload_dir['url']) . basename( $uploaded_anexa_location ), 'post_type' => 'attachment', 'post_mime_type' => $_FILES['wp_custom_attachment']['type'], 'post_title' => preg_replace('/\.[^.]+$/', '', basename( …
Not sure if this is a stupid question or not; however, I've been trying to detect when a user accesses a PDF. I want to be able to know how often a user is accessing specific PDF files. I have been playing around with the 'template_redirect' hook, but the below code doesn't seem to be functioning. function detect_access() { $server_request = $_SERVER['REQUEST_URI']; if ( strpos($server_request, '/wp-content/uploads') !== false ) { wp_redirect( home_url('/') ); exit; } } I would really appreciate …
I have uploaded some PDFs to the Media Library. I cannot find a way to set the browser favicon for the PDF media files. Where does WordPress get the favicon from? Is there anyway to control the PDF Media file favicon?
Please help! I am a newbie on Wordpress. I am looking for a workaround or plugin which can help me upload an Image on the backend (like thorugh WP Frontend Admin plugin. and on the Frontend, it comes out dynamically as clickable thumbnails which directs to the File path upon clicking. something like this website https://www.sofi.life/faithnews/ it is fairly easy to do it through elementor, but I am looking for a dynamic work around so the client can do it …
I have a folder mywebsite.com/wp-content/customUploads which contains hundreds of pdf files. At this point the url to see a pdf file is for example: mywebsite.com/wp-content/customUploads/myfile.pdf My goal is to have a url for each PDF file like: mywebsite.com/pdf-files/myfile.pdf So if a user request the above url, the website will load the pdf file. Is there a way to request the url: mywebsite.com/pdf-files/myfile.pdf and this url is translated to the following, so the file could be loaded correctly? mywebsite.com/wp-content/customUploads/myfile.pdf
I'm trying to learn if this is possible, and how I might go about implementing it. Our site is a scientific journal, and our published articles follow this permalink structure: http://ehponline.org/<article-slug> i.e. http://ehponline.org/1306796 Every article that we publish has a corresponding PDF that is available for viewing/download. Those PDFs are currently stored outside of the WP Media structure. What I am wondering is if there is a way to have a permalink URL for each article such as this: http://ehponline.org/<article-slug>/pdf …
I'm trying to create a plugin using FPDF to create an options page to print custom post types. Here is my code: <?php /* * Plugin Name: RT FPDF Tutorial * Description: A plugin created to demonstrate how to build a PDF document from WordPress posts. * Version: 1.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; } include( 'pdf-helper-functions.php'); $pdf = new PDF_HTML(); if( isset($_POST['generate_posts_pdf'])){ output_pdf(); } add_action( 'admin_menu', 'rt_fpdf_create_admin_menu' ); function rt_fpdf_create_admin_menu() { $hook = add_submenu_page( …
When I upload a JPG or PNG image, a _wp_attachment_metadata value is created in the database, but this is not the case for PDF files. Is this the normal behavior or should the _wp_attachment_metadata be created for PDF files too? I'm asking because there's a plugin I have installed that processes PDF files, and it's saying it's not able to do so due to missing metadata for the PDF files. Here's an example of the difference in my database: There …
I'm building a plugin that works only in admin. I've a page where the user choose some parameters and the script get data from posts and posts meta then it generate a pdf file and then I want to save it or in a specif folder or in the media library adding it to a specific Media Category. My questions is: How can I save by code the generated pdf file to Media Library with a specific Media Category? Regards. …