At the heart of:
in CSS
print styles add a media request for printing and use the @page
rule
@media print{ @page { size: auto; size: A4 portrait; margin: 0; border: 1px solid red; } }
Do you have a php class to create this?
I do not think you really need additional libraries for this. But you might need browser compatibility ... not?
EDIT
To support IE10 +, you can also add this rule:
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { @page { size: auto; size: A4 portrait; margin: 0; border: 1px solid red; } }
You should be able to control only CSS in order to print website content.
source share