Recommended Free Tools
Set a PDF’s paper size, orientation, and margins in CSS @page rules included in the HTML or stylesheet you send to DocRaptor. For example, this selects landscape A4 with a 10 mm margin on every side:
@page {
size: A4 landscape;
margin: 10mm;
}
Where to configure page size and margins
DocRaptor uses CSS page styling for PDF dimensions, orientation, and margins. Put the @page rule in a <style> element in the HTML submitted to DocRaptor, or in a stylesheet included with that document. Its API reference describes page size and related PDF styling as CSS-controlled (DocRaptor API Reference).
As an Amazon Associate I earn from qualifying purchases.
For a basic document, the relevant portion of the submitted HTML can look like this:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
<!doctype html>
<html>
<head>
<style>
@page {
size: A4 landscape;
margin: 10mm;
}
</style>
</head>
<body>
<h1>Quarterly report</h1>
<p>Document content goes here.</p>
</body>
</html>
Send this HTML using the DocRaptor integration already used by your application. The page-styling rule belongs in the document content or an included stylesheet; it is not a setting in a PDF reader.
#1 Best Overall
Choose a named paper size and orientation
Use a recognized page-size keyword when a standard format fits. Add landscape after the size name to change orientation; without it, the named size is portrait. For example:
@page { size: A4; }
@page { size: A4 landscape; }
DocRaptor lists US Letter as 8.5 in × 11.0 in and A4 as 210 mm × 297 mm. Its reference includes other ISO, US, ANSI, architectural, and book-format keywords; check the DocRaptor page-size keyword list for the exact supported names. The size, dimensions, and orientation guide explains how to specify them.
Specify a custom page size
If none of the named formats matches the required output, specify width and height with CSS units. The dimensions are written in that order:
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsRank #2
@page { size: 22cm 24cm; }
@page { size: 4in 8in; }
Use units such as mm, cm, or in and set dimensions to the intended finished page. DocRaptor’s custom page size tutorial shows custom dimensions in an API document.
Set uniform or individual margins
A single margin value applies to all four sides. To vary the available space on each side, set the sides independently:
@page { margin: 10mm; }
@page {
margin-top: 20mm;
margin-right: 15mm;
margin-bottom: 20mm;
margin-left: 15mm;
}
DocRaptor’s margin guide also shows @page { margin: 50px; }. Choose values according to the content and output requirements rather than assuming a particular margin is appropriate for every document. Its default is US Letter portrait with a 0.75-inch margin, according to the page rule and styling basics guide. Explicit declarations make the intended layout clear and avoid relying on defaults.
Rank #3
- hole punched
- high quality card stock
- 4 pages
- made in USA
- keyboard shortcuts
Reserve space for headers and footers
Headers and footers occupy page margin areas. Set the top or bottom margin large enough for the page-region content: DocRaptor says those areas do not automatically expand to fit a header or footer. If the margin is too small, the region can be cropped or hidden. The page regions guide and headers and footers guide describe these areas.
Changing margins also changes the space available to the main content, which can alter line wrapping and pagination. After adjusting space for a page region, generate the PDF and check that the header or footer fits and the body content still breaks where intended. DocRaptor’s Prince 12 page margin layout guide covers its page-margin layout behavior.
Use special margins for binding or a first page
For a binding layout, DocRaptor’s margins guide shows margin-inside and margin-outside so the inner and outer edges can be treated differently. For a distinct first-page layout, it shows a first-page rule such as:
Rank #4
@page:first { margin: 0; }
Use a zero margin only when a full-bleed page is intended. Confirm the result in the generated PDF, especially where the first page uses a different layout or where content approaches the page edge. See DocRaptor’s margins and bleed guide for these cases.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshoot unexpected dimensions, clipping, or pagination
- The PDF has the wrong paper size or orientation: Check that the submitted HTML or included stylesheet contains the intended
@pagerule, that the size keyword is spelled as documented, and thatlandscapeis present when needed. - A custom page is the wrong shape: Verify the width-height order and units in
size. For example,size: 4in 8inspecifies a 4-inch width and an 8-inch height. - A header or footer is cut off: Increase the corresponding top or bottom margin to leave room for its page region; the region will not enlarge that margin automatically.
- Text moves to additional pages after a margin change: This can be expected because margins change the main content area. Recheck pagination and adjust content or margin values as needed.
- Content reaches the edge unexpectedly: Review whether a zero margin or first-page-specific rule is active. Keep zero margins for layouts that intentionally use full bleed.
Or skip the browser setup
DocRaptor handles HTML-to-PDF page styling, while ScreenshotNeo is a website screenshot API and MCP server for developers. For a website capture in PNG, JPEG, WebP, or PDF, one GET request can return the result. For example, this cURL request saves a WebP capture of Stripe; see the ScreenshotNeo API documentation for request options.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Quick Recap
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo removes cookie and consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000. Sign up for the free plan.
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.

