@pdf-viewer/react
Version:
A react-pdf-viewer component for React and Next.js. Suitable for react-pdf document.
23 lines (21 loc) • 953 B
JavaScript
function e() {
if (typeof document > "u" || document.getElementById("rp-print-style"))
return;
const t = document.createElement("style");
t.id = "rp-print-style", t.textContent = `
.rp-print-zone { display: none; }
@media print {
@page { margin: 0; }
.rp-print-html-printing { height: 100%; }
.rp-print-body-printing { background: transparent; height: 100%; margin: 0; display: block; }
.rp-print-body-printing * { display: none; }
.rp-print-zone { display: block; height: 100%; }
.rp-print-page { display: flex; align-items: center; flex-direction: column; justify-content: center; height: 100%; width: 100%; page-break-after: always; page-break-inside: avoid; }
.rp-print-page:last-child { page-break-after: auto; }
.rp-print-page img, .rp-print-page canvas { display: block; max-height: 100%; max-width: 100%; direction: ltr; }
}
`, document.head.appendChild(t);
}
export {
e as injectPrintCSS
};