[SOLVED] PDF doesn't take custom css


in print format i’ve created some custom css with some classes, that work fine when I see the print preview

But these custom classes are not shown when I see the PDF exprot.

Is there any solution on this issue? Of course I want the PDF looks similar to preview

You will have to wrap your custom CSS in @media print


Thank you @netchampfaris.
That doesn’t seem to work. I am getting the same result as above.
here is the piece of css I added:

@media print {
.docdraft {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
    text-align: center;
    color: #a94442;
    background-color: #f2dede;
    border-color: #ebccd1;

Here’s what I found,

Adding, !important to your css rules will override bootstrap’s css

1 Like

You are great! Thank you @netchampfaris

If you have used ERPNext and liked it, then please help us spread the word by submitting your reviews on the following sites.




We as a community can achieve lot more than as individuals.