NOTES: My request covers software or libraries, hence why I'm posting here. I also checked the similar threads here, but they asked for something subtly different.
I have the following HTML page:
<html>
<head>
<link rel="stylesheet" type="text/css" href="font.css">
<style>
body {
font-family: "Gotham SSm A";
font-size: 22px;
}
</style>
</head>
<body>
SUMMARY
</body>
</html>
And the font definition in font.css (truncated for brevity):
@font-face {
font-family: "Gotham SSm A";
src: url(data:font/truetype;base64,...) format('truetype');
font-weight:700;
font-style:italic;
}
The page shows up fine in the browser, and when printed to PDF from the browser, is rendered fine as well. However, every utility I used to generate a PDF from server-side software (PHP) failed:
- Wkhtmltopdf messed up the fonts.
- PhantomJS messed up the fonts.
- SlimerJS failed to render, opened windows, and had unacceptable dependencies
- PrinceXML messed up the fonts and failed to parse all the CSS rules
- pandoc only converts to LaTeX and requires different utilities (on Windows/Linux) to go to PDF. What's more, it's LaTeX conversion (according to the online version I trie) messed up the fonts as well.
What are my alternatives? I need this to...
1. Respect modern CSS (including @font-face).
2. Be available on Windows & Linux with similar output on both
3. Be offline (utility or library is fine)
4. Allow commercial use
5. Be cost effective (preferably free)