Use CSS @font-face to load a web font into the HTML DocRaptor converts, then apply the declared family to your text. The font file must be reachable by DocRaptor during rendering, and the account’s rendering pipeline must support its format. For WOFF2, DocRaptor specifies Pipeline 8 or newer.
Declare and apply the font in your HTML
Define the font with @font-face, including the family name, style, weight, and a URL for the font file. Then use that exact family name in the CSS rule for the text you want to render.
As an Amazon Associate I earn from qualifying purchases.
<style>
@font-face {
font-family: "Open Sans";
font-style: normal;
font-weight: 400;
src: url("https://fonts.example.test/open-sans-regular.woff2") format("woff2");
}
body {
font-family: "Open Sans", Arial, sans-serif;
}
</style>
The URL above is illustrative, not a verified download location. Replace it with an accessible URL for a font you are licensed to use. DocRaptor’s custom font guide demonstrates an Open Sans WOFF2 URL hosted on fonts.gstatic.com; its tutorial shows the same general pattern with a fallback font.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Match the face to the text
A declaration for weight 400 and normal style describes that face only. If your document uses bold, italic, or other weights, add corresponding @font-face declarations with the same family name and the appropriate font-weight and font-style. Keep a fallback family in the CSS for characters or circumstances the chosen font does not cover.
#1 Best Overall
Make the font file reachable during rendering
Use an absolute HTTPS URL for the font, or provide a base URL when your HTML uses relative asset paths. DocRaptor’s API reference documents a default external-resource fetch period of up to 10 seconds and a configurable timeout; a blocked, expired, slow, or inaccessible URL can prevent the renderer from loading the font.
For relative assets, the DocRaptor tutorial indicates that you can provide prince_options[baseurl] or use a <base> element. Put the CSS in the supplied HTML’s <style> block or in a stylesheet DocRaptor can access. The tutorial’s older Google Fonts example uses HTTP; prefer HTTPS for a current implementation.
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
Submit the HTML to DocRaptor
The font CSS belongs in the HTML passed as document_content to the PDF API. This cURL example follows the documented submission pattern and uses test mode; supply your own API credentials and document content.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorscurl -X POST https://docraptor.com/docs
-u YOUR_API_KEY:
-d "doc[document_type]=pdf"
-d "doc[test]=true"
--data-urlencode "doc[document_content]=<html><head><style>@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;src:url('https://your-domain.example/open-sans.woff2') format('woff2')}body{font-family:'Open Sans',Arial,sans-serif}</style></head><body>PDF sample</body></html>"
-o sample.pdf
Refer to DocRaptor’s custom-font tutorial and API reference for the current API parameters and account-specific configuration. This example demonstrates the request shape; it is not a claim that a particular font URL, account, or resulting PDF has been tested.
Rank #3
Check pipeline and font-format support
DocRaptor’s font guide says WOFF 2.0 requires Pipeline 8 or newer. DocRaptor’s Pipeline 8 release notes say that release added WOFF2 support with Prince 13. The API reference maps the documented pipelines to Prince versions as follows:
| DocRaptor pipeline | Prince version listed in API reference |
|---|---|
| 10.1 | 15.1 |
| 10 | 15 |
| 9.2 | 14.3 |
| 9 | 14.1 |
| 8 | 13.5 |
| 7 | 12.5 |
| 6 | 11.4 |
These are the mappings in DocRaptor’s API reference; the pipeline configured for your account may differ from the latest available option. Check your account setting before diagnosing a format problem. DocRaptor recommends testing a newer version before changing the account default.
Rank #4
- Brand: Wiley
- Set of 2 Volumes
- A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
What changes when upgrading
DocRaptor’s Pipeline 8 release notes state that Prince 13 changed line-height: normal to use the current font’s recommended value. If line spacing or pagination changes after a pipeline upgrade, test an explicit value such as line-height: 1.2, which the release notes say restores the previous behavior. This is a layout consideration, not a remedy for a font URL that fails to load.
Verify the PDF’s appearance and font coverage
A successful API response or a visible change in one paragraph does not establish that every intended font face and glyph is present. Generate a representative PDF and inspect the actual output. Include punctuation, accented characters, and every script your documents need, and check that a fallback is available where the font may lack coverage.
Best Value
The API reference exposes prince_options[no_embed_fonts], which disables font embedding, and prince_options[no_subset_fonts], which disables font subsetting. For documents that must remain portable, inspect the resulting PDF’s font information and appearance rather than assuming that a CSS declaration guarantees embedding. Font coverage, licensing, and rendering success depend on the specific font and content; test those with the actual document.
Troubleshoot a font that does not appear
- Check the HTML: confirm the rendered document contains the
@font-facerule and that the text references precisely the same family name. - Check style and weight: confirm the text’s requested weight and style match a declared face; define additional faces when needed.
- Check the asset URL: open the URL independently, confirm it serves the expected font file over HTTPS, and ensure the rendering service can reach it within the resource-fetch period.
- Check format support: confirm the account’s pipeline supports the font format. For WOFF2, DocRaptor specifies Pipeline 8 or newer.
- Inspect a test PDF: compare the font’s appearance and representative glyphs, and verify embedding when portability matters.
- Investigate layout shifts separately: after a pipeline upgrade, check line height and pagination; Prince 13 changed the behavior of
line-height: normal.
Or skip the browser setup
If your next step is capturing a rendered website rather than generating a DocRaptor PDF, ScreenshotNeo takes a screenshot with one GET request. It removes cookie banners, popups, and chat widgets before capture; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots, and 1,000 screenshots a month are free with no card; paid plans start at $5 for 3,000.
Example request (replace the URL with the page to capture):
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. Sign up for 1,000 free screenshots a month, with no card required.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




