openhtmltopdf
openhtmltopdf copied to clipboard
Want to add/define out link font but not embedded font
Hi,
I want to add out source font in my generated PDF. I don't know how to describe it. I mean adding a font family in my CSS, who can see the the right font ONLY when installed the Font in his/her machine. This is not embedded font obviously.
I can achieve this feature through flying saucer. (No offence, openthmltopdf is great to use.)
ITextFontResolver fontResolver = renderer.getFontResolver(); fontResolver.addFont("C:\\Windows\\Fonts\\MICR.ttf",false);// here you can see the false switch to open embedded or not
But I don't know how to achieve this in openhtmltopdf, Could you please advise this ? here is what I do in openhtmltopdf
PdfRendererBuilder builder = new PdfRendererBuilder();
builder.useFastMode();
builder.withFile(new File("E:\\webapp\\data\\af59dc16-19a0-40b9-bc6a-ca9a4eb53589.html"));
builder.toStream(os);
builder.run();
here is the css font reference.
.serialCode {
position: relative;
top: 3.7in;
width: 7.6in;
height: 0.25in;
font-size: 0.1041666667in;
font-style: normal;
text-align: left;
font-family: MICR; // the font family name
left: 1.439in;
letter-spacing: 0.0283in;
top: 3.715in;
font-weight: 600;
}
Can anyone help me out : )