From the Knowledgebase

Can I write PHP code to change the shortcode parameters?

You can set most settings in the Settings -> PDF Embedder page in WordPress. These apply to all embeds by default, but you can override the settings of individual embeds by manually adding shortcode parameters to the individual [pdf-embedder] shortcodes - see details here.

It is also possible to override the global defaults by writing PHP code, using a filter named 'pdfemb_filter_shortcode_attrs'.

For example, to add the 'pagetextbox' option to every embed so you don't have to add it to every shortcode manually (there is no global setting available for this parameter), you could add the following code to your Theme's functions.php or similar:

add_filter('pdfemb_filter_shortcode_attrs', 'mypdfshortcodes', 10, 1);

function mypdfshortcodes($atts) {
   $atts['pagetextbox'] = 'on';
   return $atts;
}

You could inspect the value of $atts['url'] if you want to vary the attributes based on the specific PDF file being displayed.

Top