Use a fixed HTML element rotated with CSS, then reserve right-side margin space and test the generated PDF on several pages. wkhtmltopdf has header and footer features, but its command-line documentation does not provide a dedicated “vertical text on the right edge” switch. For static text, a fixed element in the document is the simplest starting point. If the text must include values such as the current page number, adapt a custom HTML header or footer template and use wkhtmltopdf’s page substitutions.
Choose the implementation route
Your choice depends on whether the label is static and how much control it needs.
| Route | Best for | Important checks |
|---|---|---|
| Fixed element in the converted HTML | A static label such as “Confidential” that should appear with the document body | Verify that it repeats on every page, stays inside the page boundary, and does not overlap body text. |
| Custom HTML header or footer | A label that needs page variables such as [page] or [topage] |
The documented examples are horizontal; rotation, right-edge geometry, margins and spacing require custom CSS and PDF inspection. |
The fixed-element method is the practical first attempt. Header/footer templates are more appropriate when the label changes per page.
Static vertical text with a fixed HTML element
1. Add the label to the source HTML
Place the element in the document being converted. It can be near the start or end of the body; its fixed positioning removes it from normal document flow.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →#1 Best Overall
- EDIT text, images & designs in PDF documents. ORGANIZE PDFs. Convert PDFs to Word, Excel & ePub.
- READ and Comment PDFs – Intuitive reading modes & document commenting and mark up.
- CREATE, COMBINE, SCAN and COMPRESS PDFs
- FILL forms & Digitally Sign PDFs. PROTECT and Encrypt PDFs
- LIFETIME License for 1 Windows PC or Laptop. 5GB MobiDrive Cloud Storage Included.
<div class="vertical-text">Confidential</div>
2. Rotate and position it with CSS
.vertical-text {
position: fixed;
right: 0;
top: 50%;
-webkit-transform: rotate(90deg);
-webkit-transform-origin: center bottom;
white-space: nowrap;
}
This follows the commonly suggested wkhtmltopdf technique: a fixed element at the right edge, rotated with the WebKit-prefixed transform supported by wkhtmltopdf’s rendering engine. The exact top, transform origin and offset depend on the label length, paper size and installed wkhtmltopdf build.
3. Reserve room for the label
A label at right: 0 can touch the printable edge or cover body content. Give the document a right margin and move the label into that reserved strip.
@page {
margin: 18mm 24mm 18mm 18mm;
}
.vertical-text {
position: fixed;
right: 6mm;
top: 50%;
-webkit-transform: rotate(90deg);
-webkit-transform-origin: center bottom;
white-space: nowrap;
font: 10pt Arial, sans-serif;
}
The larger right margin creates a predictable safety area. If the text still clips, increase the margin or move the element farther inward. Check both the page edge and the body edge: a label can be inside the paper but still overlap paragraphs, tables or images.
4. Convert and inspect more than one page
wkhtmltopdf --margin-right 24mm input.html output.pdf
Open the PDF and inspect the first page, a middle page and the final page. Fixed-position repetition is affected by wkhtmltopdf’s pagination and layout behavior; a result that looks correct on page one is not proof that every page is correct. Test documents with short and long pages, tables that cross page breaks, different fonts and the actual paper size used in production.
Free tools Windows power users keep installed
One-click scans. No signup required.
Dynamic labels with an HTML header or footer
wkhtmltopdf documents custom HTML headers and footers and substitutions including [page], [frompage] and [topage]. These are useful when the side label must say something such as “Page 3 of 12” or include a changing value.
Create a template
A header or footer template can contain JavaScript that reads the substituted query-string values and writes them into an element. The following template illustrates the structure; the rotation and dimensions are deliberately customized for a right-side label rather than copied from the usual horizontal-header example.
Rank #2
- Edit PDFs with Ease. Modify text, images, and layouts directly within your PDF documents.
- Convert & Organize. Export PDFs to Word, Excel, or ePub, and organize files with ease.
- Read & Annotate. Enjoy intuitive reading modes and powerful tools to comment, highlight, and mark up PDFs.
- Create & Manage PDFs. Create new PDFs, combine multiple files, scan documents, and compress for easy sharing.
- Fill & Sign Forms. Complete forms and digitally sign documents with secure e-signature tools.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<style>
html, body { margin: 0; padding: 0; }
#side-label {
position: fixed;
right: 4mm;
top: 50mm;
white-space: nowrap;
-webkit-transform: rotate(90deg);
-webkit-transform-origin: right top;
font: 9pt Arial, sans-serif;
}
</style>
</head>
<body>
<div id="side-label"></div>
<script>
function value(name) {
var query = window.location.search.substring(1).split('&');
for (var i = 0; i < query.length; i++) {
var pair = query[i].split('=');
if (decodeURIComponent(pair[0]) === name)
return decodeURIComponent(pair[1] || '');
}
return '';
}
document.getElementById('side-label').textContent =
'Page ' + value('page') + ' of ' + value('topage');
</script>
</body>
</html>
Save it as side-footer.html, then pass it to wkhtmltopdf. Use footer options if you want footer rendering semantics; use header options if that better matches your document.
wkhtmltopdf
--margin-right 24mm
--footer-html side-footer.html
--footer-spacing 0
input.html output.pdf
The template’s geometry must be tested with your installed build. Header/footer spacing and page margins determine the available area; excessive spacing can place the rendered header or footer outside the page. A rotated template may also need a larger right margin than a normal horizontal footer.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesKeep the label from clipping the document
Use the page margin as a protected column
Set --margin-right (or the equivalent library setting) wide enough for the rotated label, then place the label within that column. Do not rely on the PDF viewer’s visible edge as a safe boundary: printer margins, paper formats and scaling can differ.
Control the transform origin
-webkit-transform-origin changes the point around which the text rotates. center bottom is a useful starting point for a fixed body element; a header/footer label often needs right top or a measured millimetre offset. If the text swings outside the page after rotation, change the origin before changing the font size.
Prevent wrapping
Use white-space: nowrap. A wrapped label changes its dimensions before rotation and commonly causes unexpected overlap or clipping.
Account for writing direction and reading order
rotate(90deg) makes Latin text read from bottom toward top when viewed along the right edge. If your design requires top-to-bottom reading, try rotate(-90deg) and adjust the origin and offsets. wkhtmltopdf’s older WebKit engine makes visual verification essential.
Rank #3
- Create and edit PDFs. Collaborate with ease. E-sign documents and collect signatures. Get everything done in one app, wherever you go.
- Edit text and images without jumping to another app.
- E-sign documents or request e-signatures on any device. Recipients don’t need to log in to e-sign.
- Convert PDFs to editable Microsoft Word, Excel, or PowerPoint documents.
- Share PDFs for collaboration. Commenting features make it easy for reviewers to comment, mark up, and annotate.
Troubleshooting common failures
The text appears only on the first page
Cause: the element is being laid out as ordinary content, or the installed wkhtmltopdf build handles fixed elements differently around page breaks.
Fix: confirm position: fixed is applied, keep the element outside containers with clipping rules such as overflow: hidden, and test a minimal HTML file. If repetition remains unreliable, move the label into a custom header/footer template and validate that route.
The label is cut off at the right edge
Cause: the rotated bounding box extends beyond the printable page.
Fix: increase the right margin, move the element inward, change -webkit-transform-origin, or reduce the font size. Inspect at the actual paper size rather than a viewer thumbnail.
Recommended Free Tools
The label overlaps paragraphs or tables
Cause: the body has no reserved side column.
Fix: increase --margin-right and match the CSS right offset to that column. Wide tables may still extend into the margin; constrain their width or revise the table layout.
Page variables are blank
Cause: the template is being opened directly in a browser, or the variable names are not read from the query string.
Rank #4
- Perfect Adobe Acrobat Pro alternative – lifetime license for Windows 10 and 11.
- EDIT text, images, pages, hyperlinks, designs in PDF documents. ORGANIZE PDFs.
- READ and Comment on PDFs – Intuitive reading modes & document commenting and mark up tools!
- CREATE, COMBINE, SCAN and COMPRESS PDFs.
- FILL forms & Digitally Sign PDFs. Work with Digital certificates
Fix: render it through wkhtmltopdf’s --header-html or --footer-html option, then inspect the template’s URL query string and JavaScript decoding. Test with a simple visible value before adding rotation.
Header or footer content is outside the page
Cause: header/footer spacing or margins are too large for the selected paper size.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Fix: reduce spacing, increase the relevant page margin, or move the label’s fixed coordinates. Keep the total of margins and spacing within the page’s printable area.
The result differs between machines
Cause: wkhtmltopdf packages can use different Qt/WebKit builds, fonts and command-line defaults.
Fix: pin the wkhtmltopdf version in your build environment, install the same fonts, and keep a regression PDF containing short pages, long pages and page breaks. Compare rendered output, not only exit codes.
Operational and performance considerations
- Rendering cost: a fixed text node adds little work, while a complex header/footer template introduces another HTML rendering path and JavaScript execution.
- Reliability: avoid animations, asynchronous font loading and layout-dependent JavaScript in the label. A deterministic font and fixed dimensions are easier to reproduce.
- Pagination: test long tables, images and explicit page breaks because pagination can expose overlap that is invisible in a short sample.
- Accessibility: rotated decorative text may be read in an unexpected order by PDF assistive technology. If it conveys essential information, also provide that information in normal document text.
- Output validation: check page count, label presence, clipping and overlap in an automated PDF review step where the document is business-critical.
Or skip the browser setup
If your actual requirement is to capture a clean website screenshot or PDF without maintaining a browser pipeline, ScreenshotNeo provides a one-request API and an MCP server for AI clients. It accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups and chat widgets; bot checks, blank pages, timeouts, failed loads and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers. Its options include custom CSS and JavaScript, full-page capture, PDF settings, device and viewport controls, waits, request blocking, authentication headers, cookies, geolocation, caching, signed links, asynchronous jobs and bulk capture.
For a direct capture, see the ScreenshotNeo API documentation:
Best Value
- ALL-IN-ONE SOLUTION – read, edit, convert, merge and protect your PDF files
- MAXIMUM FUNCIONALITY – create interactive forms, compare PDFs, bates numbering, find and replace text or colors, convert documents, OCR engine, comment, highlight, fill out and print forms, document protection and others
- EASY TO INSTALL AND USE – well-structured user-interface, in-program instructions, free tech support whenever you need it
- GREAT VALUE FOR MONEY - why spend a fortune if you can have maximum functionality at a reasonable price - this also fits the requirements of companies very well
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Python:
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
Node.js:
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
An MCP server lets Claude, Cursor and other MCP clients call screenshot, page-info and PDF tools. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.
Frequently asked questions
Does wkhtmltopdf have a vertical-right-text command-line option?
No dedicated option is documented. The effect is built with HTML/CSS positioning or by adapting a custom header/footer template.
Should I use a header or a fixed body element?
Use a fixed body element for static text. Use a header/footer template when page variables or separate rendering control are required.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Why must I test several pages?
Fixed-element repetition and rotated geometry can vary with pagination, content length and wkhtmltopdf builds. A single-page test cannot reveal those failures.
Frequently Asked Questions
Can I place the text on the left instead?
Yes. Change the horizontal offset from right to left, reserve left margin space, and rework the transform origin for the new edge.
Will this work for every paper size automatically?
Not without testing. Paper dimensions, margins and label length change the rotated bounding box, so validate each production format.
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.




