This is a test to see how print-o-matic and print-pro-matic handle targeting a non-existing element:
No element? no problem… do nothing.
Now what happens if we have one element that does not exist in a list of elements:
A Pluginoven Test Site
This is a test to see how print-o-matic and print-pro-matic handle targeting a non-existing element:
No element? no problem… do nothing.
Now what happens if we have one element that does not exist in a list of elements:
As of print-o-matic version 2.0.1 the ability to use class to target a print element in external print triggers has been added. Basically it works the same as using the data-print_target attribute but instead uses a unique classname in the format of printtarget-<target_id>.
Create a target element. The element below is a div with an id of ‘my_print_target’:
<div id="my_print_target">This is the print target wrapped in a div with an element of 'my_print_target' as explained above</div>
Add an external trigger using the new class-trigger method. We’ll use a simple button like so:
<button id="my_print_button" class="printomatic printtarget-#my_print_target">Print Trigger</button>
Like in the original example, we need to add the hidden print trigger using a print-me shortcode with the same id as our external trigger and a printstyle=”external” attribute:
[print-me id="my_print_button" printstyle="external"/]
This is a test to use a accessible button as the print trigger.
[print-me printicon="false" tag="button" title="print-me" /]
This is a test of using print-pro-matic with the LaTeX2HTML plugin.
In the case of a large gallery of images, it could happen that a page break would split images across pages.
For example, what happens when this gallery is printed?
Here is an example of using Print-O-Matic to print a WordPress Chart using wp-charts.
[wpcharts type=”piechart” legend=”false” titles=”Title 1, Title 2, Title 3, Title 4″ values=”3,7,5,12″ id=”my_chart”]
[print-me target="%prev%"/]
Works in 2.0.
Pre 2.0:
It seems we need to wrap the chart shortcode in a div so we can target that div and include it’s related javascript.
Still not. maybe we also need to include the chart js on the page?
Nope. It seems the HTML Canvas element is not cloning it’s content that was generated by the javascript… hmmm.
This is a test of Print-O-Matic using multiple targets, for example:
And now for the trigger:
[print-me target="#targ_id_one, #targ_id_two"/]
This is a test for printing various forms using Print-O-Matic and Print-Pro-Matic plugins.
[print-me title="Print Standard HTML Form" alt="Print the HTML form" target="#html_form, #texter"/]
As of version 1.6.7c we introduced a new printstyle value ‘external’ for Print-O-Matic. Now it is possible to create an external button to trigger a print in a less-hacky way. Here is an example of this works: To print the following div with an id of ‘print_me_please’:
<div id="print_me_please">This is our target print element</div>
First we create a kind of roll-your-own print trigger. The details that must be included are:
printomatic
or printomatictext
data-print_target
attributeFor example:
<button id="my_print_button" class="printomatic" data-print_target="#print_me_please">Print Trigger</button>
Which will output:
The final thing we need to do is include a hidden print trigger using a print-me shortcode with the same id as our external trigger and the new external printstyle attribute. This shortcode must be placed someplace on the same page, and will load in all the required scripts and settings to make the print trigger work correctly.
[print-me id="my_print_button" printstyle="external"/]
This shortcode will not output anything to the page.
That’s it. You are done! Let us know on the WordPress Support Forum if you require any further assistance.
This is a quick test to inject a logo at the top of a print-pro-matic page using only css.
In this case, the print element has a class of #post-2182 and it is targeted as normal:
[print-me target="#post-2182"]
However now we add the following css to the our theme:
@media print {
#post-2182::before {
content: url(https://spacedonkey.de/wp-content/uploads/2012/09/ninja_turtles-300x223.jpg);
}
}
This will place the logo in the ::before pseudo class of the targeted print element on the print page. however if the images does NOT exist on the page then it will not have enough time to load before print is triggered. Let’s try it out:
[print-me target="#post-2182" pause_before_print="500"/]
Probably now image right? Now click the print icon again. Image. How to solve this?
Guess we need to use top_html and bottom_html to define custom content and provide a bit of pause_before_print time.