Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Generate the PDF first, then upload its bytes to an online host and return a URL for that specific object. For a private Amazon S3 file, the usual Python flow is: create the PDF, upload it with Boto3, and call generate_presigned_url('get_object'). The resulting link is temporary, not a permanent public address.

Separate PDF creation from online delivery

A PDF library writes document bytes; it does not publish those bytes on the internet. ReportLab can create the document, while an object store such as Amazon S3 or a media platform such as Cloudinary can host and deliver it.

Choose the access model before writing code:

  • Private, short-lived sharing: upload to a private S3 bucket and issue a presigned GET URL.
  • Client upload without cloud credentials: generate a presigned PUT or POST request for the client. That authorization is for uploading, not downloading.
  • Long-lived public address: configure the host’s public delivery mechanism and accept its access implications. Do not label an expiring signed URL permanent.
  • Media-platform delivery: upload the PDF to Cloudinary and use its documented delivery or signed-download configuration.

The examples below use S3 because one server-side request can upload the file and create a time-limited read link.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install and configure the Python dependencies

Install the SDK and a PDF generator in your virtual environment:

#1 Best Overall
Lexar D40E 128GB Dual USB 3.2 Gen 1 Type-C Jump Drive, Champagne Silver
  • USB-C 2-in-1 storage OTG: The Lexar JumpDrive Dual Drive D40E features USB Type-A and Type-C connectors in a slim, portable form factor for easy device compatibility
  • Transfer speeds up to 100MB/s: Based on internal testing, performance may vary depending upon the host device, interface, and usage conditions. 1MB=1,000,000 bytes
  • Plug and Play: Widely compatible with USB Type-C smartphones, tablets, laptops, Macs, and traditional Type-A devices, no software installation required. The 360° swivel design allows for easy switching between connectors without the hassle of losing a cap
  • Durable & Compact: The Lexar D40E USB memory stick features a metal enclosure, withstands temperatures from 0° to 50° C (32°F to 122°F), and is lightweight at 26g with dimensions of 70.4 x 16.9 x 11.7mm
  • Security & Warranty: Securely protects files using an advanced security software solution with 256-bit AES encryption. Backed by a Lexar 3-year limited warranty
python -m pip install boto3 reportlab

Configure AWS credentials through the standard environment, shared credentials file, or an attached IAM role. Do not put access keys in source code. Grant the application only the S3 permissions it needs, such as putting objects and creating presigned requests.

Complete example: generate, upload, and return a presigned URL

This runnable example creates a small PDF with ReportLab, uploads it with an explicit content type, and returns a URL that expires after one hour. Replace the bucket and region with values from your account.

from datetime import datetime, timezone
from pathlib import Path
import os
import uuid

import boto3
from botocore.config import Config
from reportlab.lib.pagesizes import letter
from reportlab.pdfgen import canvas

BUCKET = os.environ["PDF_BUCKET"]
REGION = os.environ.get("AWS_REGION", "us-east-1")
EXPIRY_SECONDS = 3600

pdf_path = Path("report.pdf")
canvas_obj = canvas.Canvas(str(pdf_path), pagesize=letter)
canvas_obj.setTitle("Generated report")
canvas_obj.drawString(72, 720, "Generated report")
canvas_obj.drawString(
    72,
    700,
    datetime.now(timezone.utc).isoformat(),
)
canvas_obj.showPage()
canvas_obj.save()

# A unique key avoids unintentionally replacing an existing object.
object_key = f"reports/{uuid.uuid4()}.pdf"
s3 = boto3.client(
    "s3",
    region_name=REGION,
    config=Config(signature_version="s3v4"),
)

s3.upload_file(
    str(pdf_path),
    BUCKET,
    object_key,
    ExtraArgs={"ContentType": "application/pdf"},
)

url = s3.generate_presigned_url(
    "get_object",
    Params={"Bucket": BUCKET, "Key": object_key},
    ExpiresIn=EXPIRY_SECONDS,
)

print(url)

Set PDF_BUCKET and AWS_REGION, run the script, and open the printed address before it expires. Boto3’s API reference documents a default ExpiresIn value of 3600 seconds; specifying it explicitly makes the intended lifetime clear. AWS recommends Signature Version 4, so the client configuration above sets signature_version="s3v4".

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why the object key matters

Uploading another file to the same bucket and key replaces the existing object. A UUID-based key avoids accidental overwrites. If replacement is intentional, use a deterministic key and document that behavior; otherwise include a report ID, timestamp, or UUID.

Return JSON from a web endpoint

In a Flask or FastAPI handler, keep the upload and signing steps on the server and return the URL as JSON. Never expose AWS credentials to a browser.

return {
    "url": url,
    "expires_in": EXPIRY_SECONDS,
    "object_key": object_key,
}

Presigned URLs: what the link does and does not mean

An S3 presigned GET URL grants access to one operation and one object for a defined period. Anyone who possesses the link can use the access it grants until it expires, subject to AWS’s signing and bucket rules. It does not make the bucket public and it does not create a permanent URL.

Rank #2
SANDISK 128GB Ultra Flair, USB-A Flash Drive, Up to 150MB/s Read Speeds
  • High-speed USB 3.0 performance of up to 150MB/s(1) [(1) Write to drive up to 15x faster than standard USB 2.0 drives (4MB/s); varies by drive capacity. Up to 150MB/s read speed. USB 3.0 port required. Based on internal testing; performance may be lower depending on host device, usage conditions, and other factors; 1MB=1,000,000 bytes]
  • Transfer a full-length movie in less than 30 seconds(2) [(2) Based on 1.2GB MPEG-4 video transfer with USB 3.0 host device. Results may vary based on host device, file attributes and other factors]
  • Transfer to drive up to 15 times faster than standard USB 2.0 drives(1)
  • Sleek, durable metal casing
  • Easy-to-use password protection for your private files(3) [(3)Password protection uses 128-bit AES encryption and is supported by Windows 7, Windows 8, Windows 10, and Mac OS X v10.9 plus; Software download required for Mac, visit the SanDisk SecureAccess support page]

The expiry is counted from signing time. If a consumer may need a longer download window, choose a longer value within your account and security policy, or issue a fresh URL when requested. A URL cannot outlive restrictions imposed by the signing credentials or other service rules.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Client uploads without giving clients AWS credentials

If a browser or mobile client must upload directly, your trusted server can create a presigned request. The client then sends the generated method, URL, and required fields exactly as returned.

Presigned POST

post = s3.generate_presigned_post(
    Bucket=BUCKET,
    Key=object_key,
    Fields={"Content-Type": "application/pdf"},
    Conditions=[
        {"Content-Type": "application/pdf"},
        ["content-length-range", 1, 10 * 1024 * 1024],
    ],
    ExpiresIn=600,
)

# Return post["url"] and post["fields"] to the client.
# The client must submit every returned field together with the file.

A presigned POST is an upload authorization. It is not automatically a download URL. After the upload succeeds, your server can create a separate presigned GET URL for the resulting key.

Presigned PUT

A presigned PUT URL authorizes a client to send the file with the method and headers your server specified. The client must use the exact URL, method, and required headers; changing them can invalidate the signature. Generate a GET URL afterward when the file needs to be downloaded.

Cloudinary and other delivery choices

Cloudinary documents PDF upload and delivery, including signed downloads for private or authenticated assets. It can be a better fit when you already manage images and media there. Verify the current account settings and access configuration for PDF assets.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For S3 public delivery, configure the host’s public-access policy deliberately and understand that anyone who can discover the address may retrieve the file. No complete public-bucket recipe is provided here, so use your organization’s current AWS guidance for that configuration rather than copying an assumed policy.

Rank #3
2 Pack 64GB USB Flash Drive USB 2.0 Thumb Drives Jump Drive Fold Storage Memory Stick Swivel Design - Black
  • What You Get - 2 pack 64GB genuine USB 2.0 flash drives, 12-month warranty and lifetime friendly customer service
  • Great for All Ages and Purposes – the thumb drives are suitable for storing digital data for school, business or daily usage. Apply to data storage of music, photos, movies and other files
  • Easy to Use - Plug and play USB memory stick, no need to install any software. Support Windows 7 / 8 / 10 / Vista / XP / Unix / 2000 / ME / NT Linux and Mac OS, compatible with USB 2.0 and 1.1 ports
  • Convenient Design - 360°metal swivel cap with matt surface and ring designed zip drive can protect USB connector, avoid to leave your fingerprint and easily attach to your key chain to avoid from losing and for easy carrying
  • Brand Yourself - Brand the flash drive with your company's name and provide company's overview, policies, etc. to the newly joined employees or your customers

Make the generated file suitable for delivery

  • Set the object metadata to ContentType: application/pdf so browsers and download clients handle it correctly.
  • Use a stable naming scheme only when overwriting is intentional; otherwise generate unique keys.
  • Keep temporary local files out of publicly served directories and delete them after a successful upload if they are no longer needed.
  • Validate inputs used in the PDF and object key. Never let untrusted text become an arbitrary filesystem path or an unrestricted bucket key.
  • Decide how long files should be retained and remove old objects with an application cleanup job or the storage service’s lifecycle controls.

Performance, reliability, and cost considerations

PDF generation and upload are separate failure points. Generate in memory for small documents when practical, or use a temporary file for large documents. Avoid regenerating identical reports when a cacheable object key and expiration policy meet your requirements.

Use a bounded request timeout around any API call, retry transient network failures with backoff, and make retries safe. A deterministic key can make an upload retry overwrite the same intended object; a random key on every retry can leave orphaned files that require cleanup. Record the bucket, key, creation time, and expiry alongside the URL so your application can revoke or replace access by stopping issuance of new links and deleting the object.

Storage, request, transfer, and media-platform charges vary by provider, region, and account. The material available here does not establish current prices, retention limits, or regional differences, so check your provider’s current billing documentation before estimating a production cost.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Troubleshooting common failures

AccessDenied during upload

Check that the active IAM identity can put objects in the selected bucket and prefix, that the bucket policy permits the request, and that the region is correct. If the bucket uses encryption, include the required encryption parameters and permissions.

The generated link returns 403

Confirm that the object key and bucket are exactly the values used to sign the URL, the URL has not expired, and the signing credentials remain valid. Clock skew on the signing machine can also make a newly generated URL appear invalid.

The PDF downloads as a generic file

Upload it with ContentType: application/pdf. Existing objects retain their metadata until you replace or copy them with corrected metadata.

Rank #4
SIMMAX 32GB Memory Stick USB 2.0 Flash Drives Swivel Thumb Drive Pen Drive (32GB Purple)
  • GOOD VALUE PACKAGE - 1 Pack 32GB Memory Stick USB 2.0 Flash Drives with great cost performance and high quality.
  • BIG CAPACITY - The available capacity: 29.10GB-29.8GB, You can save the data of movies, music, photos, designs, programs, manuals, handouts in a high speed.Good performance in digital data storing, transferring and sharing with families, friends, workmates, clients and machines.
  • EASY TO USE & PLUG AND WORK - Support windows 7 / 8 / 10 / Vista / XP / 2000 / ME / NT Linux and Mac OS, Compatible with USB2.0 and below.
  • TWISTTURN DESIGN & EASY CARRY - The metal clip rotates 360° round the ABS plastic body which with rubber oil skin feeling finish. The capless design can avoid lossing of cap, and providing efficient protection to the USB port.
  • WARRANTY & SUPPORT - SIMMAX logo is laser printed on the USB connector surface, our products are of good quality and we promise that any problem about the product within one year since you buy.

The client upload fails with “signature mismatch”

For a POST, include every returned field and do not rename form parameters. For a PUT, preserve the exact HTTP method and signed headers. Do not use an upload URL as though it were a GET URL.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The wrong document appears after an upload

Inspect the object key. Reusing a key replaces the prior object, so use a unique key or implement explicit versioning and overwrite rules.

The PDF is incomplete or corrupt

Close or finalize the PDF before uploading. With ReportLab, call showPage() as needed and save() before handing the file to Boto3. Check the uploaded object’s size and download it once in a test environment.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your next step is creating a visual preview or verifying how the hosted PDF page renders, ScreenshotNeo can capture a URL with one request. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and responses identify the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.

After your application has a reachable PDF or HTML URL, call the API (see the ScreenshotNeo documentation):

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/report.pdf -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://example.com/report.pdf"}, timeout=90)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://example.com/report.pdf' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`HTTP ${res.status}`);

ScreenshotNeo includes full-page capture, device and retina settings, PDF options, custom CSS and JavaScript, selector waits, request blocking, cookies and headers, caching with a chosen TTL, signed image links, asynchronous webhooks, bulk capture for up to 100 URLs per call, and a usage API. Every feature is on every plan: 1,000 screenshots per month are free with no card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.

FAQ

Can I return the URL before the upload finishes?

No. Return it only after the upload request succeeds; otherwise the link may reference an object that does not yet exist.

Best Value
Sale
IMEASON Swivel Design 16GB USB Flash Drive with Keychain, USB 2.0 Portable Thumb Drive Memory Stick, FAT32 Format Flashdrive for Data Storage, Photos, Music, Files (Black, 16 GB)
  • 【16GB Flash Drive】USB flash drives with 16GB capacity, meet your needs of daily use on work, school, home and travelling for photos, music, videos, files storage and transfer. IMEASON thumb drives can be used to store different files, easy to data backup.
  • 【Metal Swivel Cap Design】USB thumb drive is metal swivel cover provides extra protection for the usb thumbdrive connector, no usb drive cap to lose; keychain design makes it easier to carry without worrying lose it.
  • 【Wide Compatibility】USB drive supports Windows 7/8/10/11 / Vista / XP / Unix / 2000 / ME / NT Linux and Mac OS, also Supports USB 2.0 and 1.1 ports. USB Stick support TV, desktop, notebook computer, car, audio and other device. The USB Memory Stick is your great data storage and transfer companion with traveling and working.
  • 【Easy to use】usb memory stick is plug and play without any software installation. Just simply plug the Flashdrive into the port of your USB-compatible devices such as computer, laptop to start data storage or transmission.
  • 【What You Get】16 GB USB Flash Drive Thumb Drive, The default format of the usb storage flash drive is FAT32.

Can I revoke one presigned URL?

S3 does not provide a per-link cancellation switch. Delete or replace the object, invalidate the signing credentials when appropriate, or wait for the URL to expire.

Should my API return the bucket name?

Usually return the signed URL and your own document identifier. Exposing the bucket name is not required for downloading and can reveal infrastructure details.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Can I return the URL before the upload finishes?

No. Return it only after the upload request succeeds; otherwise the link may reference an object that does not yet exist.

Can I revoke one presigned URL?

S3 does not provide a per-link cancellation switch. Delete or replace the object, invalidate the signing credentials when appropriate, or wait for the URL to expire.

Should my API return the bucket name?

Usually return the signed URL and your own document identifier. Exposing the bucket name is not required for downloading and can reveal infrastructure details.

The Bottom Line

Create the PDF, upload it to a host, and generate the URL using the access model you actually need. For private S3 sharing, a presigned GET URL is the practical Python default, provided you treat its expiry and object permissions as part of the design.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.