October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

How to Set Page Size and Margins in PDFCrowd HTML-to-PDF Conversions

Set PDFCrowd’s page size with a supported preset or custom dimensions, then control each margin independently. Learn when to use zero margins, expanded-height pages and content fitting.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

In PDFCrowd’s HTTP API, set page_size to use a supported paper preset, or set page_width and page_height for custom dimensions. Control whitespace with margin_top, margin_right, margin_bottom and margin_left; each defaults to 0.4in. For edge-to-edge output, use no_margins=true. Orientation and content fitting are separate settings, and CSS can add whitespace even when API margins are zero.

Set page size, orientation and margins in one request

PDFCrowd’s documented HTTP API example uses a page preset, an orientation and four individually specified margins. Replace the example URL and credentials with your own input and account details:

As an Amazon Associate I earn from qualifying purchases.

curl -f -s -S 
  -u 'USERNAME:API_KEY' 
  -o output.pdf 
  -F url=https://example.com/ 
  -F page_size=Letter 
  -F orientation=landscape 
  -F margin_top=0.5in 
  -F margin_right=0.5in 
  -F margin_bottom=0.5in 
  -F margin_left=0.5in 
  https://api.pdfcrowd.com/convert/24.04/

This adapts PDFCrowd’s documented HTTP layout example; it is not a report of a conversion test. For full-bleed output, PDFCrowd recommends no_margins instead of individual margin settings. See the PDFCrowd API reference for supported parameters and the HTTP API documentation for request details.

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

Choose a preset or define custom page dimensions

Use a standard paper preset

Set page_size to one of PDFCrowd’s documented presets: A0, A1, A2, A3, A4, A5, A6 or Letter. The documented default is A4. Use a preset when the output needs to match a familiar paper size rather than an exact custom canvas.

Specify width and height

For a nonstandard page, set page_width and page_height. The API reference documents inches (in), millimeters (mm), centimeters (cm), pixels (px) and points (pt) as units. Its default dimensions are 8.27in wide by 11.7in high. The reference describes 200in as the safe maximum because larger dimensions may fail to open in some PDF viewers.

Use orientation=portrait or orientation=landscape to choose page orientation; portrait is the documented default. Orientation is distinct from the dimensions themselves, so check both when output pages appear to have the wrong shape.

Rank #2
1 Second Auto Size Scanner PDF JPG 16MP Resolution Portable Document Scanner for Converting and Editing
  • LIGHTWEIGHT AND FOLDABLE STRUCTURE: Foldable design (30x6x8cm) and lightweight (1000g) make it portable for travel or home use. Compact shape fits perfectly on your workbench without taking up much space
  • SIMPLE CONNECTION: Works with USB connection without the need for additional programs for quick installation. Simple controls make it easy to operate both beginners and regular users with regular size papers
  • QUICK DOCUMENT PROCESSING: Automatically scan suggestions one page per second, greatly increase productivity. Ideal for workplaces, schools, legal/financial areas where large capacity is required
  • TEXT CONVERSION TECHNOLOGY: Smart OCR function works in over 200 languages, changes scanned files to editable text for easy storage and editing Seamless digital conversion of paper documents improves workflow
  • EXCELLENT IMAGEING: Equipped with a 16MP clear camera, this portable document scanner produces crisp, accurate images of documents and keeps important content intact. Perfect for striking scans of contracts, receipts and books

Set margins or remove them

Control each edge independently

Set margin_top, margin_right, margin_bottom and margin_left when you need predictable whitespace. Each margin defaults to 0.4in. Margin values accept in, mm, cm, px or pt. Specify all four if consistent margins matter; otherwise, set only the edges that need different spacing.

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

Use a zero-margin page

Set no_margins=true to disable the PDF page margins. This removes API-level page margins, not whitespace created inside the HTML. PDFCrowd recommends combining it with custom CSS when the content itself must fill the page.

Choose paginated output or one expanded-height page

For ordinary documents, keep the standard paginated layout and choose page dimensions and margins suited to the intended paper or screen. For content where page breaks are undesirable, such as a web page or infographic, set page_height=-1 to request a single page whose height expands to fit its content.

Fit content without confusing scaling with page size

The content_fit_mode setting determines how HTML is fitted to the print area; it does not define the physical page size or margins. PDFCrowd documents this option for converters 24.04 and later. Available values are auto (the default), smart-scaling, no-scaling, viewport-width, content-width, single-page and single-page-ratio.

If content is wider than the printable area, first identify whether the cause is the source layout, the page dimensions, the margins or the fitting mode. no-scaling can leave oversized content clipped; width-fitting and single-page modes can change how content is scaled or fitted. Consult the API reference for the documented behavior of each mode.

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

Diagnose whitespace, clipping and unexpected page breaks

  • There is still whitespace with zero API margins: Inspect CSS on html and body, as well as any rendered header or footer. PDFCrowd’s layout FAQ notes that the header, footer and content areas contain rendered HTML that can define its own top-level padding and margins. To remove those CSS gaps, try html, body { margin: 0; padding: 0; }. Also inspect configured header and footer heights. See PDFCrowd’s layout FAQ.
  • Content is clipped: Check whether the content exceeds the printable area and whether content_fit_mode=no-scaling is in use. Review the source layout, dimensions, margins and fit behavior before enlarging the page.
  • The page shape is wrong: Verify the preset or custom width and height, then check orientation. Portrait is the default.
  • The document is much longer than expected or breaks awkwardly: Decide whether page breaks are needed. For content intended to occupy one expanding page, PDFCrowd documents page_height=-1; otherwise, use a paginated page size and appropriate fit mode.
  • A very large custom page does not open in a viewer: The API reference describes 200in as the safe maximum and warns that larger dimensions may fail to open in some PDF viewers. Use dimensions within that limit.
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 actual need is a website screenshot rather than a paginated HTML-to-PDF conversion, ScreenshotNeo returns a PNG, JPEG, WebP or PDF from one GET request. For example, this cURL request captures a webpage to a WebP file:

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. Before capture, cookie banners are accepted like a visitor and more than 60 known consent platforms, newsletter popups and chat widgets are removed; each step can be turned off. Bot checks, blank pages, timeouts, failed loads and cache hits cost nothing, and the response indicates the page verdict and billing status. Its MCP server offers take_screenshot, get_page_info and capture_pdf for AI agents. The free plan includes 1,000 shots a month with no card; paid plans start at $5 for 3,000 shots.

Sign up for 1,000 free screenshots a month, with no card required.

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.

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

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.