How to find in my pdf template if it's called for pdf or preview
-
Hi,
I have build a custom template for my post, to be called from your excellent plugin.
Also, I’m taking advantage I have 2 urls:
– posting/pdf
– posting/pdf-previewI’m using the first one to download the pdf file. And I’m using the second one to offer my users the choice to print directly from the browser.
I would like to insert some additional code in my pdf-template to check if it’s been called from /pdf-preview. If it’s so, I would like to insert an additional javascript window.print() at the end of the pdf-template (so, when the page finishes loading in the browser, the browser’s print dialog will open)
Something like this:
<?php
if (the pdf-template has been called for pdf-preview) {
echo ‘<script type=”text/javascript”>window.print();</script>’;
}
?>Is it possible? thanks for your help
- The topic ‘How to find in my pdf template if it's called for pdf or preview’ is closed to new replies.