The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →To add a text watermark to every page of an existing PDF, create a one-page watermark with ReportLab, read both PDFs with pypdf, merge the watermark page into each source page, and write a new file. Pass over=False for text behind the original content or over=True for a foreground stamp.
What you will build
The workflow uses two focused libraries:
- ReportLab creates a PDF page containing your text. Its canvas uses Cartesian coordinates with the origin at the lower-left corner.
- pypdf reads the input PDF, merges the watermark page, and writes the result.
The watermark is normally generated once and reused for every page. The output is a new PDF; the source file is not modified in place.
Install the dependencies
Use a virtual environment when possible, then install both packages:
python -m pip install reportlab pypdf
For production applications, pin and verify the versions installed in your deployment because PDF behavior can change between library releases.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Complete example: watermark every page
This script places a translucent “CONFIDENTIAL” label near the lower-left corner and puts it behind existing page content.
from io import BytesIO
from reportlab.lib.pagesizes import letter
from reportlab.pdfgen import canvas
from pypdf import PdfReader, PdfWriter
INPUT = "input.pdf"
OUTPUT = "output-watermarked.pdf"
# Build a one-page PDF containing the watermark text.
watermark_bytes = BytesIO()
wm = canvas.Canvas(watermark_bytes, pagesize=letter)
wm.setFont("Helvetica", 36)
# setFillAlpha is available in ReportLab versions that expose transparency.
# Remove this line if your installed version does not support it.
wm.setFillAlpha(0.25)
wm.drawString(72, 72, "CONFIDENTIAL")
wm.showPage()
wm.save()
watermark_bytes.seek(0)
watermark_page = PdfReader(watermark_bytes).pages[0]
reader = PdfReader(INPUT)
writer = PdfWriter()
for page in reader.pages:
# False places the watermark under the original page content.
page.merge_page(watermark_page, over=False)
writer.add_page(page)
with open(OUTPUT, "wb") as output:
writer.write(output)
print(f"Wrote {OUTPUT}")
Run it with python watermark.py. Open the resulting file in a PDF viewer and check several pages, including pages with images, tables, and rotated content.
Put the text above the PDF content
A background watermark can disappear where the page has an opaque white rectangle. Use a foreground merge when the label must remain visible:
for page in reader.pages:
page.merge_page(watermark_page, over=True)
writer.add_page(page)
In pypdf terminology, a stamp is placed on top, while a watermark is placed in the background. The merge operation is otherwise the same. Omitting over uses the overlay behavior provided by the installed pypdf version, so specify it explicitly when layer order matters.
Recommended Free Tools
Control text, color, opacity, and position
Change the wording and font
ReportLab supplies the text controls. For example:
wm.setFont("Helvetica-Bold", 24)
wm.setFillColorRGB(0.8, 0.1, 0.1)
wm.drawString(72, 100, "DRAFT — DO NOT DISTRIBUTE")
Built-in fonts such as Helvetica are convenient. If you need a specific typeface, register a supported font with ReportLab and confirm that the font is embedded as required by your distribution or archival policy.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Use a centered or diagonal watermark
A plain merge_page preserves the watermark page’s original geometry. For scaling, translation, or rotation, use merge_transformed_page and a Transformation:
from pypdf import Transformation
transform = (
Transformation()
.rotate(45)
.scale(1.2)
.translate(tx=180, ty=250)
)
for page in reader.pages:
page.merge_transformed_page(
watermark_page,
transform,
over=False,
)
writer.add_page(page)
Adjust the translation and scale for the watermark page size and the target page’s media box. Rotation is in degrees. Render a test page before applying a transform to a large batch because coordinate systems and page boxes affect the visible result.
Handle page rotation correctly
Some PDFs store rotation as page metadata rather than rotating the page’s content stream. If a merge appears sideways or is positioned unexpectedly, transfer the rotation into the content before merging:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
for page in reader.pages:
page.transfer_rotation_to_content()
page.merge_page(watermark_page, over=False)
writer.add_page(page)
Do this only when needed. A document with mixed portrait and landscape pages may require inspecting each page’s rotation and geometry, then creating or transforming a watermark that fits that page.
Support mixed page sizes
The minimal example creates a letter-sized watermark. That is suitable only when the destination pages use compatible dimensions. PDFs often mix letter, A4, legal, portrait, and landscape pages.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
For reliable placement:
- Read each page’s media box or crop box.
- Create a watermark canvas with matching width and height, or use a transformation that scales and translates the reusable watermark.
- Choose coordinates relative to the page dimensions rather than assuming 612 × 792 points.
- Test pages with different boxes and orientations in the same file.
One point equals 1/72 inch in the PDF coordinate system. The default ReportLab origin remains the lower-left corner, so increasing x moves right and increasing y moves up.
Generate a watermark for each page size
When exact geometry matters, create a watermark page inside the loop. This example uses each page’s width and height and places centered text:
from io import BytesIO
from reportlab.pdfgen import canvas
from pypdf import PdfReader, PdfWriter
reader = PdfReader("input.pdf")
writer = PdfWriter()
for page in reader.pages:
width = float(page.mediabox.width)
height = float(page.mediabox.height)
stream = BytesIO()
wm = canvas.Canvas(stream, pagesize=(width, height))
wm.setFont("Helvetica", 30)
wm.setFillAlpha(0.20)
text = "CONFIDENTIAL"
text_width = wm.stringWidth(text, "Helvetica", 30)
wm.drawString((width - text_width) / 2, height / 2, text)
wm.showPage()
wm.save()
stream.seek(0)
watermark_page = PdfReader(stream).pages[0]
page.merge_page(watermark_page, over=False)
writer.add_page(page)
with open("output-watermarked.pdf", "wb") as output:
writer.write(output)
This approach costs more work per page but avoids applying letter-sized coordinates to an A4 or landscape page.
Transparency and rendering caveats
setFillAlpha is optional and version-dependent. Check the ReportLab version installed in your environment before relying on it. If transparency is unavailable, use a lighter fill color or omit the call. PDF viewers can render transparency, fonts, and overlaid graphics differently, so verify the actual output in the viewers and print workflows that matter to you.
Troubleshooting
ModuleNotFoundError
The interpreter running the script does not have the packages. Install them with that interpreter, for example python -m pip install reportlab pypdf, and check that your IDE uses the same virtual environment.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
The watermark is hidden
Opaque page content may cover an underlay. Change over=False to over=True, reduce the watermark’s opacity, or move it into an unused margin.
Free tools Windows power users keep installed
One-click scans. No signup required.
The watermark is off the page
ReportLab coordinates start at the lower-left, not the upper-left. Check the page’s width and height and avoid hard-coded letter dimensions for mixed-size documents.
Rotated pages look wrong
Call transfer_rotation_to_content() before merging, then test both portrait and landscape pages. Do not apply it blindly if your input has already-normalized content.
The output is blank or corrupt
Ensure the canvas calls showPage() and save(), rewind every BytesIO object with seek(0), and close the output through writer.write(). Write to a new path while debugging so the original remains available.
Some pages have no visible watermark
Inspect page boxes, clipping, transparency, and layer order. A watermark generated for one page size can fall outside another page’s visible area. Generate per-page watermarks or use a page-specific transformation.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Performance, reliability, and file handling
The reusable-watermark version keeps the in-memory watermark small and avoids regenerating it for every page. The per-page version is preferable when geometry differs. For large files, process one input at a time, write to a temporary output, and replace the destination only after a successful write. Keep the source PDF until you have validated the output.
Watermarking changes the PDF’s content streams; it does not guarantee that text cannot be removed. If the watermark is a legal or compliance control, combine it with the document-management and access controls required by your policy. Also check whether annotations, forms, encryption, bookmarks, and digital signatures need special handling in your pypdf version before batch processing.
Or skip the browser setup
If your workflow also needs clean screenshots of web pages, ScreenshotNeo provides a one-call API rather than requiring you to configure a headless browser:
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 documentation for request options. It accepts cookie and consent banners as a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, with the result identified by response headers. Its MCP server lets Claude, Cursor, and other MCP clients call take_screenshot, get_page_info, and capture_pdf. The Free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 shots. Sign up for the free plan.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Practical checklist
- Install and pin compatible ReportLab and pypdf versions.
- Create the watermark canvas, call
showPage(),save(), and rewind the stream. - Use
over=Falsefor a background watermark andover=Truefor a foreground stamp. - Use
Transformationfor scale, translation, or rotation. - Normalize problematic page rotation with
transfer_rotation_to_content(). - Match watermark geometry to mixed page sizes.
- Render and inspect representative output pages before replacing the source.
Frequently Asked Questions
Can I watermark only selected pages?
Yes. Iterate with an index and merge the watermark only when that index is in your selected set; add every other page unchanged.
Does this permanently flatten the watermark?
The watermark becomes part of the page content stream, but PDF editing tools may still remove or cover it. It is not a security boundary by itself.
Why use a separate watermark PDF?
ReportLab handles drawing and typography, while pypdf handles PDF reading, page merging, and writing. The separate page also makes the same design reusable across pages.
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.

