digitalfabrik/integreat-cms

View on GitHub
integreat_cms/static/src/css/pdf_page_export.css

Summary

Maintainability
Test Coverage
@import "../fonts/raleway/raleway-pdf.css";
@import "../fonts/open-sans/open-sans-pdf.css";
@import "../fonts/noto-sans-sc/noto-sans-sc-pdf.css";
@import "../fonts/dejavu-sans/dejavu-sans-pdf.css";
@import "../fonts/noto-sans-ethiopic/noto-sans-ethiopic-pdf.css";
@import "../fonts/noto-sans-georgian/noto-sans-georgian-pdf.css";

@page {
    size: a4;
    margin: 2cm;
    @frame header_frame {
        /* static frames: stay the same across different pages
        is marked with -pdf-frame-content */
        -pdf-frame-content: header;
        left: 1cm;
        top: 0.5cm;
        right: 1cm;
        height: 1cm;
    }
    @frame footer_frame {
        -pdf-frame-content: footer;
        left: 1cm;
        bottom: 0.1cm;
        right: 1cm;
        height: 1.5cm;
    }
    @frame footer_bar_frame {
        /* due to a malfunction of border-top property,
        which selects all other borders (left, right, bottom) also,
        this work-around uses a separate static frame with minimal height
        to draw a single horizontale line at the bottom of the page */
        -pdf-frame-content: footer_bar;
        height: 0.001cm;
        bottom: 2.0001cm;
        left: 1cm;
        right: 1cm;
        border-top-color: black;
        border-top-style: solid;
        border-top-width: 1px;
    }
    @frame header_bar_frame {
        /* due to a malfunction of border-top property,
        which selects all other borders (left, right, bottom) also,
        this work-around uses a separate static frame with minimal height
        to draw a single horizontale line at the bottom of the page */
        -pdf-frame-content: header_bar;
        height: 0.001cm;
        top: 1.6001cm;
        left: 1cm;
        right: 1cm;
        border-top-color: black;
        border-top-style: solid;
        border-top-width: 1px;
    }
}
.content,
#footer {
    font-size: large;
}
/* the following styles are applied only to the table of content
at the first page of the pdf document */
pdftoc {
    /* applied to the whole toc */
    font-size: large;
}
pdftoc.pdftoclevel1 {
    /* applied for all children of the root page */
    margin-left: 1em;
}
pdftoc.pdftoclevel2 {
    /* applied to all sub headers of the pages */
    margin-left: 2em;
}
pdftoc.pdftoclevel3 {
    /* applied to all sub headers of the pages */
    margin-left: 3em;
}
pdftoc.pdftoclevel4 {
    /* applied to all sub headers of the pages */
    margin-left: 4em;
}
pdftoc.pdftoclevel5 {
    /* applied to all sub headers of the pages */
    margin-left: 5em;
}
h1,
h2,
h3,
h4,
h5,
h6 {
    font-size: x-large;
    margin: 0.83em 0;
    padding: 3px 0px;
}
h2,
h3,
h4,
h5,
h6 {
    -pdf-outline: false;
}
h1.level-0 {
    font-size: xx-large;
    margin: 0.67em 0;
    -pdf-outline-level: 0;
    /* keep the following html tag in the same frame */
    -pdf-keep-with-next: false;
}
h1.level-1 {
    -pdf-outline-level: 1;
}
h1.level-2 {
    -pdf-outline-level: 2;
}
h1.level-3 {
    -pdf-outline-level: 3;
}
h1.level-4 {
    -pdf-outline-level: 4;
}
h1.level-5 {
    -pdf-outline-level: 5;
}
/* title of document on first page should not show up
    in the table of content */
#title_page {
    -pdf-outline: false;
}
p,
ol,
ul {
    padding: 0;
}
li {
    padding: 1px 0px;
}
ul li div:first-child {
    display: inline-block;
}
.right-to-left {
    text-align: right;
}
#header {
    text-align: right;
}
#first-footer {
    text-align: left;
}
#second-footer {
    text-align: center;
}
#third-footer {
    text-align: right;
    background-color: white;
}

/* force linebreak between images wrapped in links */
p a img {
    display: block;
}
p a:first-child img {
    display: inline-block;
}