I need to generate PDF from HTML files. The HTML will be processed by iText. I can only control the HTML production. My goal is to put the necessary things in the HTML/CSS.
For each HTML file, I can control the size, header and the footer by setting contents with CSS, like this:
<style type="text/css">
@page{
size: A4;
@top-center {
color: rgb(51, 102, 153);
content: "METADATA SYSTEM";
font-weight: bold;
font-style: italic;
font-size: 24px;
font-family: Raleway;
}
@bottom-right {
color: red;
content: "Page " counter(page) " of " counter(pages);
}
}
</style>
This produces the header and the footer and works as expected.
The problem
I need to add a link in the footer (on the left). But as far as I know, there is no way to write something link <a href="link">link</a> for content, according to the content documentation.
I would like to write something like:
@bottom-left {
color: red;
content: <a href="link">link</a>;
}
But this is invalid.
This is valid, and looks well, but it does not generate a link.
@bottom-left {
color: blue;
content: "https://ambiente.azores.gov.pt";
}
Am I able to set the content as a link in the footer?
Related question
If content is not an option, I'll check other approaches like the one How to use HTML to print header and footer on every printed page of a document?