Site logo

Archived topic

Download PDF e2pdf Shortcode in Hook Element

7 replies · Started by Martin on March 22, 2022

Viewing posts 1–8 of 8

Hello.
I am attempting to add a 'Download Post as a PDF' button in a Custom Post Type that uses ACF fields.
All the coding is added to a Hook in Elements.
All PHP works fine up to the point of displaying the E2PDF shortcode so i wonder if anyone can spot what I've done wrong here:

<?php
$post_id = get_the_ID();
echo do_shortcode('[e2pdf-download id="1" dataset="'.$post_id.'"]'); 
?>
[e2pdf-download id="1"]

I've created a template in E2PDF settings but the button doesn't appear.

I'd also be interested in an alternative to E2PDF if anyone know of a better (easier) way of creating a PDF from everything in the main content DIV?

Thanks for reading.

Martin

Hi Martin.

It would be best to reach out to the support of this plugin with regards to its functionality and how to make the PDF export button appear.

A PDF plugin I’ve personally tried is Save as PDF plugin by PDFcrowd: https://wordpress.org/plugins/save-as-pdf-by-pdfcrowd/

See: https://share.getcloudapp.com/mXuYAykR

Take note though that we can’t vouch for this plugin though as this is out of our scope.

Here is the repository of PDF plugins: https://wordpress.org/plugins/search/save+as+pdf/

Kindly use one that suits you best.

Hope this clarifies. :)

Hi there,

if you can share a link to the page its meant to display on i can take a quick look to see if theres any obvious issues.

I've added a link in the 'Private information' field.

I was kinda hoping that there would be some markup i could see but theres nothing there.
I wonder if the shortcode has to be inside the content - what happens if you add it to the post editor ?

I've given up with it.
There are better alternatives available for generating a PDF from posts.

Thanks for looking into it.

Martin

No problems - sometimes best to move on to something new. Hope you have better luck with the next one.

This archived topic is closed to new replies.