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

Set PDFShift’s format option to a standard paper size such as A4 or Letter, or pass custom width and height values with units. Set margin as a shorthand string for uniform or CSS-style sides, or use an object to specify each side independently. If your first page spills onto a second page, check the space PDFShift reserves for headers or footers.

Set the PDF page size with format

PDFShift’s conversion options use format to determine page dimensions. Choose a standard format for conventional paper sizes, or provide custom width and height when your output needs a nonstandard size. The available API documentation extract lists these formats and custom units; because that extract is hosted on GitHub Gist rather than the current official reference, confirm option details against PDFShift’s current API documentation before deploying: PDFShift API documentation extract.

Approach Examples in the API extract When to use it
Standard format Letter, Legal, Tabloid, Ledger, A0, A1, A2, A3, A4, A5 Use when the PDF should match a familiar paper size.
Custom dimensions Width and height values using in, cm, or mm Use for nonstandard layouts, labels, or other fixed-size output.

Keep the page size and the HTML layout in agreement. A page that is smaller than the content’s required width or height may cause wrapping or extra pages; changing margins cannot correct an unsuitable page dimension.

Set margins with shorthand or per-side values

The margin option accepts either a shorthand string or an object with top, right, bottom, and left values. The examples below are from the API documentation extract linked above.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
PDF Converter Ultimate - Convert PDF files into Word, Excel, PowerPoint and others - PDF converter software with OCR recognition compatible with Windows 11 / 10 / 8.1 / 8 / 7
  • Convert your PDF files into Word, Excel & Co. the easy way
  • Convert scanned documents thanks to our new 2022 OCR technology
  • Adjustable conversion settings
  • No subscription! Lifetime license!
  • Compatible with Windows 11, 10, 8.1, 7 - Internet connection required
Value Effect
10px Applies 10px to all four sides.
10px 0 Applies 10px to top and bottom, and zero to left and right.
10px 0 20px Applies 10px to the top, zero to the horizontal sides, and 20px to the bottom.
Side-specific object Set top, right, bottom, and left independently.

Use shorthand when the layout is symmetrical and an object when, for example, the binding edge needs more room than the other sides. Confirm the accepted object syntax and value units against the current API reference.

Account for headers and footers

Headers and footers need room outside the document’s main content area. PDFShift says it applies margin space so a header or footer can be displayed; if the first page is already filled to its height, this reserved space can move content onto a second page. See PDFShift’s explanation in the PDFShift Help Center.

Rank #2
Doxillion Free Document Converter – Converts DOCX, DOC, PDF, WPS and Many More Files Quickly [Download]
  • Convert over 50 document file formats.
  • Preview your files from Doxillion before converting them.
  • Use batch conversion to convert thousands of files at once.
  • Enjoy an easy-to-use, intuitive interface with a Drag and Drop file option.
  • Burn your converted or original files directly to disc.

PDFShift’s suggested first-page CSS examples remove the corresponding margin:

  • For a footer: @page:first { margin-bottom: 0 }
  • For a header: @page:first { margin-top: 0 }

Apply these overrides only when removing that margin is appropriate for your design. If you need a margin on the first page, set a smaller intentional value rather than removing it outright.

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.
Rank #3
PDF Extra Ultimate | Complete PDF Reader and Editor | Create, Edit, Convert, Combine, Comment, Fill & Sign PDFs | Yearly License | 1 Windows PC & 2 Mobile Devices | 1 User
  • 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
  • 1 Year License for 1 Windows & 2 Mobile (Android and/or iOS) devices.

Control page breaks when you cannot change the source HTML

If the source document is outside your control, PDFShift’s page-break guidance shows that CSS can be supplied in the conversion request and used to target an element. For example, a break-before: page rule can force a selected element to start on a new page. Use a selector that identifies the intended element, and verify the result with the actual source page because its layout determines where the break falls. Refer to the page-break guidance in PDFShift’s Help Center.

Or skip the browser setup

PDFShift converts HTML to PDF; ScreenshotNeo is a separate website screenshot API and MCP server for capturing a webpage as an image or PDF. For a webpage capture, one GET request can return a PDF:

Rank #4
PDF Extra Lifetime - Professional PDF Editor - Best Adobe Acrobat Pro Alternative - Lifetime License for Windows PC
  • 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
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -d format=pdf -o page.pdf

See the ScreenshotNeo API documentation for the available request parameters. ScreenshotNeo accepts cookie and consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each of those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and billing status. Its MCP server gives AI agents tools to take screenshots, inspect page information, and capture PDFs. The free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. These are webpage captures, not a substitute for configuring PDFShift’s HTML-to-PDF conversion options. Learn about ScreenshotNeo or sign up for 1,000 free screenshots a month with no card.

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

Frequently Asked Questions

Can I set different left and right margins in PDFShift?

Yes. Use the margin object’s side-specific values instead of a shorthand string.

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

Can I use a custom PDF page size?

Yes. The retrieved API documentation extract describes custom width and height values using inches, centimeters, or millimeters; verify the syntax in the current PDFShift reference.

Quick Recap

Bestseller No. 1
PDF Converter Ultimate - Convert PDF files into Word, Excel, PowerPoint and others - PDF converter software with OCR recognition compatible with Windows 11 / 10 / 8.1 / 8 / 7
PDF Converter Ultimate - Convert PDF files into Word, Excel, PowerPoint and others - PDF converter software with OCR recognition compatible with Windows 11 / 10 / 8.1 / 8 / 7
Convert your PDF files into Word, Excel & Co. the easy way; Convert scanned documents thanks to our new 2022 OCR technology
Bestseller No. 2
Doxillion Free Document Converter – Converts DOCX, DOC, PDF, WPS and Many More Files Quickly [Download]
Doxillion Free Document Converter – Converts DOCX, DOC, PDF, WPS and Many More Files Quickly [Download]
Convert over 50 document file formats.; Preview your files from Doxillion before converting them.
Bestseller No. 3
PDF Extra Ultimate | Complete PDF Reader and Editor | Create, Edit, Convert, Combine, Comment, Fill & Sign PDFs | Yearly License | 1 Windows PC & 2 Mobile Devices | 1 User
PDF Extra Ultimate | Complete PDF Reader and Editor | Create, Edit, Convert, Combine, Comment, Fill & Sign PDFs | Yearly License | 1 Windows PC & 2 Mobile Devices | 1 User
READ and Comment PDFs – Intuitive reading modes & document commenting and mark up.; CREATE, COMBINE, SCAN and COMPRESS PDFs
$83.88
Bestseller No. 4
PDF Extra Lifetime - Professional PDF Editor - Best Adobe Acrobat Pro Alternative - Lifetime License for Windows PC
PDF Extra Lifetime - Professional PDF Editor - Best Adobe Acrobat Pro Alternative - Lifetime License for Windows PC
Perfect Adobe Acrobat Pro alternative – lifetime license for Windows 10 and 11.; EDIT text, images, pages, hyperlinks, designs in PDF documents. ORGANIZE PDFs.
$99.99
Bestseller No. 5
Doxillion Free Document Converter for Mac – Converts DOCX, DOC, PDF, WPS and Many More Files Quickly [Download]
Doxillion Free Document Converter for Mac – Converts DOCX, DOC, PDF, WPS and Many More Files Quickly [Download]
Convert over 50 document file formats.; Preview your files from Doxillion before converting them.
Best Value
Doxillion Free Document Converter for Mac – Converts DOCX, DOC, PDF, WPS and Many More Files Quickly [Download]
  • Convert over 50 document file formats.
  • Preview your files from Doxillion before converting them.
  • Use batch conversion to convert thousands of files at once.
  • Enjoy an easy-to-use, intuitive interface with a Drag and Drop file option.
  • Burn your converted or original files directly to disc.

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.