Skip to content

Commit

Permalink
[#75] Update css in IFrame
Browse files Browse the repository at this point in the history
  • Loading branch information
ifirmawan committed Nov 13, 2024
1 parent 5b91cbd commit 4207aac
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions frontend/src/components/PrintDocument/IFrame.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ const IFrame = ({ children, htmlID = "ardoc-print-iframe" }) => {
const body = ref?.contentDocument?.body;

// create a style
let css = "@page {";
css += "size: 210mm 297mm; margin: 15mm;";
css += "}";
css +=
"* { -webkit-print-color-adjust: exact !important; color-adjust: exact !important; }";
const css = `
* {
-webkit-print-color-adjust: exact !important;
color-adjust: exact !important;
font-family: "Open Sans", sans-serif;
}
@page {
size: A4;
}`
const style = document.createElement("style");
style.type = "text/css";
style.media = "print";
Expand Down

0 comments on commit 4207aac

Please sign in to comment.