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.

Set the PDF option orientation to Landscape. For one generated PDF, pass it in the options array for the PDF generator call; to make it the configured PDF service’s default, add it under knp_snappy.pdf.options in config/packages/knp_snappy.yaml. KnpSnappyBundle uses wkhtmltopdf for PDF generation, whose documented orientation values are Landscape and Portrait, with Portrait as the default.

Set landscape for one PDF

Pass an options array to the PDF generator method. For HTML already held in a PHP variable, the call is:

$pdf = $knpSnappyPdf->getOutputFromHtml($html, ['orientation' => 'Landscape']);

$knpSnappyPdf here represents the PDF service or generator object already available in your application; $html is the HTML to render. The method returns the generated PDF output. Use the PDF service, not the bundle’s image service, when you need PDF page orientation.

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

If you are writing the result to a file, provide the same option array as the generator method’s options argument:

#1 Best Overall
Brother Compact Monochrome Laser Printer, HLL2395DW, Flatbed Copy & Scan, Wireless Printing, NFC with Refresh Subscription Free Trial and Amazon Dash Replenishment Ready
  • Engineered for convenience – This new Brother Monochrome Laser Printer is conveniently equipped with a flatbed scan glass for quick copying and scanning. Mobile Device Compatibility AirPrint, Google Cloud Print 2.0, Brother iPrint and Scan, Mopria, Cortado Workplace
  • Optimized for efficiency – Engineered with new features, the HL L2395DW laser printer (replacement for the HLL2380DW) and has been optimized for efficiency, allowing you to print up to 36 pages per minute(1)
  • Faster, high quality prints: This monochrome laser printer is built with a 250 sheet paper capacity that helps improve efficiency due to less time spent refilling trays. It also handles both letter and legal sized paper. Power Source AC 120V 50/60Hz.Machine Noise (Ready/Printing): 30dB / 50dB
  • Cloud based print & scan – Print from and scan to popular Cloud services directly from the 2.7" color touchscreen, including Dropbox, Google Drive, Evernote, OneNote, and more(4)
  • Wireless printing & exceptional support – This printer’s simple to connect wireless technology allows you to submit print jobs from your laptop, smartphone, desktop, and tablets(2). The "Touch to connect" printing with NFC delivers added convenience(3).
$knpSnappyPdf->generateFromHtml(
    $html,
    '/path/to/file.pdf',
    ['orientation' => 'Landscape']
);

Use the method signature supported by the Snappy and KnpSnappyBundle versions installed in your project. Older examples online may target older Symfony or bundle releases, so check your installed version rather than assuming every example’s argument order applies unchanged.

Make landscape the configured PDF default

To request landscape for PDFs generated through the configured knp_snappy.pdf service, set the option in the bundle’s PDF configuration:

# config/packages/knp_snappy.yaml
knp_snappy:
    pdf:
        options:
            orientation: Landscape

This is a service-level setting rather than a change to the HTML itself. It affects PDFs generated through that configured PDF service. If only one report, export, or document should be landscape, pass the option to that generation call instead of changing the default for every output. The KnpSnappyBundle configuration also selects the wkhtmltopdf binary used by the PDF service.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Brother MFC-L3710CW Compact Digital Color All-in-One Printer Providing Laser Printer Quality Results with Wireless, Amazon Dash Replenishment Ready
  • FAST PRINT AND SCAN: The Brother MFC-L3710CW lets you get things done with up to 19 ppm print speed and scans up to 29 ipm in black and 22 ipm in color
  • AFFORDABLE AND FLEXIBLE COLOR PRINTING: Affordably print professional quality, rich, vivid color documents with laser printer quality. The 250 sheet adjustable paper tray helps minimize refills and the manual feed slot handles varied printing needs
  • 3.7” COLOR TOUCHSCREEN: Print from and scan to popular cloud apps directly from the 3.7" color touchscreen including Dropbox, Google Drive, Evernote, OneNote and more. Save time by creating custom shortcuts on the touchscreen for your most used features.
  • PRINT AND CONNECT YOUR WAY: Print wirelessly from your desktop, laptop, smartphone and tablet with built-in wireless, and Wi-Fi Direct or connect locally to a single computer via USB interface.
  • UNIT DIMENSIONS (WxDxH): 16.1” W x 18.7” D x 16.3” H

Orientation, paper size, and page dimensions

Orientation controls whether the output page is portrait or landscape; it does not by itself select a different paper size or force content to fit. wkhtmltopdf treats page size, explicit width and height, and margins as separate options. If a landscape page is still cramped, check the dimensions and margins as well as the content’s layout.

  • Orientation: use Landscape or Portrait. wkhtmltopdf documents portrait as the default.
  • Paper size: select this separately when the output needs a specific paper format.
  • Width and height: use explicit dimensions when the required page dimensions are not met by the selected paper size and orientation.
  • Margins: review them when content is clipped or has too little usable page area.

When combining these settings, confirm the resulting PDF in the renderer used by the application. Orientation alone is not a substitute for checking tables, wide content, headers, footers, and page breaks.

Troubleshoot landscape output

The PDF is still portrait

  • Check that the value is spelled and capitalized as Landscape.
  • Verify the option is in the generator call’s options argument, not in an HTTP response status or headers array.
  • Confirm that the application is generating a PDF through knp_snappy.pdf, rather than using the image service.
  • Check the configured wkhtmltopdf binary path and which binary version the application actually invokes.
  • For service-wide configuration, confirm the deployed application is loading the intended config/packages/knp_snappy.yaml settings.

The option array causes an argument or type error

Method signatures can differ across installed Snappy and bundle versions. Inspect the method signature for the version in the project and put the options array in the method’s options position. A historical Stack Overflow example demonstrates the two-argument getOutputFromHtml($html, ['orientation' => 'Landscape']) form, but it dates from 2012 and concerns Symfony 2.1; treat it as an illustration, not a version guarantee.

Rank #3
MixPad Free Multitrack Recording Studio and Music Mixing Software [Download]
  • Create a mix using audio, music and voice tracks and recordings.
  • Customize your tracks with amazing effects and helpful editing tools.
  • Use tools like the Beat Maker and Midi Creator.
  • Work efficiently by using Bookmarks and tools like Effect Chain, which allow you to apply multiple effects at a time
  • Use one of the many other NCH multimedia applications that are integrated with MixPad.

Landscape works, but content does not fit

Check the selected paper size, width and height settings, and margins. Also inspect the HTML’s own widths and print styles: a page rotated to landscape can still clip a fixed-width element or split a table awkwardly. Adjust the page geometry and document layout together, then render again.

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

JavaScript-dependent content is missing or incomplete

KnpSnappyBundle’s README warns that wkhtmltopdf is not fully compatible with ES6 APIs, so JavaScript-heavy pages may have compatibility problems. Where a needed API is unsupported by the rendering engine, a suitable polyfill may be necessary. Orientation will not fix a page that has not rendered its content.

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 goal is to capture a live webpage as an image or PDF rather than configure a KnpSnappyBundle-generated PDF, ScreenshotNeo offers a one-request API. This is a separate service, not a way to set the orientation option in your Symfony app. Its screenshot API can return PNG, JPEG, WebP, or PDF; see the ScreenshotNeo API documentation for available parameters.

Rank #4
Corel PDF Fusion Software
  • Save money by using PDF Fusion to view over 100 file formats without having to purchase additional software
  • Merge incompatible files quickly and easily by dragging and dropping in PDF Fusion to create a new PDF documents
  • Save time with PDF Fusion's editing tools to reuse the content from existing documents without starting from scratch
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo accepts cookie or consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and each response identifies the page verdict and billing status in headers. An MCP server provides screenshot and PDF tools for AI clients, including Claude and Cursor. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Learn more at ScreenshotNeo. Sign up for 1,000 free screenshots a month, with no card required.

Frequently Asked Questions

Does landscape orientation change the HTML before wkhtmltopdf renders it?

No. It is a PDF output option passed to wkhtmltopdf through the generator; it does not rewrite the source HTML.

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.

Can I use lowercase `landscape`?

Use the documented value `Landscape` (or `Portrait`) to match wkhtmltopdf’s accepted orientation values.

Quick Recap

Bestseller No. 3
MixPad Free Multitrack Recording Studio and Music Mixing Software [Download]
MixPad Free Multitrack Recording Studio and Music Mixing Software [Download]
Create a mix using audio, music and voice tracks and recordings.; Customize your tracks with amazing effects and helpful editing tools.
Bestseller No. 4

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.