Free tools Windows power users keep installed
One-click scans. No signup required.
Symfony does not render PDF files by itself. Render your Twig template or expose the page at an absolute URL, then pass that HTML to a PDF engine. Use Dompdf for print-oriented documents with simple CSS, KnpSnappyBundle with wkhtmltopdf when you already use that utility, Browsershot for a Puppeteer/Chrome renderer, or Gotenberg when you want Chromium behind an HTTP service. BrowserKit and Symfony HttpClient can fetch HTML, but they do not execute page JavaScript, so they are not browser-faithful PDF renderers.
Choose the rendering engine first
The right Symfony implementation depends mainly on CSS and JavaScript fidelity, deployment constraints, and how much control you need over remote assets.
| Engine | Best fit | Important limitation or requirement | Useful controls |
|---|---|---|---|
| Dompdf | Pure-PHP reports and invoices with conservative, print-oriented CSS | Its documentation describes mostly CSS 2.1 support; flexbox and CSS Grid are not supported. | Render HTML in PHP, set paper size, and stream or return PDF bytes. |
| KnpSnappyBundle + wkhtmltopdf | Existing Symfony systems that already depend on wkhtmltopdf | Requires the wkhtmltopdf binary; the bundle documents incomplete ES6 compatibility. | Convert one URL, multiple URLs, or HTML; return a PdfResponse. |
| Browsershot | Browser-like output from a PHP API | Requires Node, Puppeteer, and headless Chrome in the runtime. | Backgrounds, tagged PDFs, orientation, scale, page ranges, URL or HTML input. |
| Gotenberg | A separately operated Chromium conversion service | You must run and secure the service and account for its network boundary. | URL or HTML endpoints, selector and network-idle waits, asset-failure handling, backgrounds, page ranges, and outbound URL filtering. |
For JavaScript-heavy pages, choose Browsershot or Gotenberg. For a self-contained PHP deployment where the document uses simple CSS, Dompdf has the lowest infrastructure overhead. Treat wkhtmltopdf as a practical legacy choice rather than a modern browser replacement.
A reliable Symfony conversion workflow
- Produce deterministic HTML. Render Twig with all data needed for the document, or expose a route that can be fetched without an interactive login.
- Make assets reachable. Use absolute
https://URLs for stylesheets, images, and fonts when the renderer loads a URL. Relative paths commonly produce an unstyled or image-free PDF. - Select the engine. Match the engine to your CSS and JavaScript requirements instead of trying to make one renderer handle every document.
- Wait for dynamic content. With Chromium engines, wait for a selector or network-idle condition. A PHP HTTP client retrieves source HTML but does not run its scripts.
- Return bytes with the correct response. Set
Content-Type: application/pdfand a usefulContent-Disposition, or save the file for later delivery.
Option 1: Render a Twig view with Dompdf
Dompdf is a PHP layout engine suited to reports, invoices, and other documents that can use conservative CSS. Its project describes it as mostly CSS 2.1 compliant; plan around that boundary rather than assuming flexbox or Grid will work.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →#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.
Install and render
Install the library with Composer, inject Twig into a controller or service, and render the template before handing the resulting string to Dompdf:
composer require dompdf/dompdf
<?php
namespace AppController;
use DompdfDompdf;
use DompdfOptions;
use SymfonyBundleFrameworkBundleControllerAbstractController;
use SymfonyComponentHttpFoundationResponse;
use SymfonyComponentRoutingAttributeRoute;
final class ReportController extends AbstractController
{
#[Route('/reports/{id}.pdf', name: 'report_pdf')]
public function pdf(int $id): Response
{
// Load your entity and pass its data to Twig in real code.
$html = $this->renderView('report.html.twig', ['id' => $id]);
$options = new Options();
// Enable this only when the document truly needs remote assets.
$options->set('isRemoteEnabled', true);
$dompdf = new Dompdf($options);
$dompdf->loadHtml($html);
$dompdf->setPaper('A4');
$dompdf->render();
return new Response($dompdf->output(), 200, [
'Content-Type' => 'application/pdf',
'Content-Disposition' => 'inline; filename="report.pdf"',
]);
}
}
If remote resources are enabled, the server must have cURL or allow_url_fopen available. Keep Dompdf’s local-file chroot restriction in place, and avoid enabling remote fetching merely to make a broken asset path appear to work. If you can package images and styles locally, that is easier to secure and reproduce.
Dompdf-specific checks
- Replace flexbox and Grid layouts with block, table, or float-based print CSS.
- Use explicit widths, margins, and page-break rules for predictable pagination.
- Verify that fonts and images are reachable from the PHP process, not just from your browser.
Option 2: KnpSnappyBundle and wkhtmltopdf
KnpSnappyBundle is a Symfony integration for wkhtmltopdf. The bundle can generate a PDF from one URL, several URLs, or rendered HTML. Install the bundle and a wkhtmltopdf binary, then configure the binary path in your Symfony environment.
Convert an absolute URL
composer require knplabs/knp-snappy-bundle
<?php
use KnpSnappyPdf;
use KnpBundleSnappyBundleSnappyResponsePdfResponse;
use SymfonyComponentRoutingGeneratorUrlGeneratorInterface;
public function report(Pdf $knpSnappyPdf): PdfResponse
{
$url = $this->generateUrl(
'report_html',
[],
UrlGeneratorInterface::ABSOLUTE_URL
);
return new PdfResponse(
$knpSnappyPdf->getOutput($url),
'report.pdf'
);
}
Generate an absolute URL deliberately. A renderer running outside your web process cannot resolve a browser-only relative path to app.css or images/logo.svg. You can also call the service’s HTML-generation method when Twig has already produced the markup.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
wkhtmltopdf uses a legacy WebKit engine. The bundle documentation warns about incomplete ES6 support, so pages depending on modern JavaScript APIs can render incorrectly or before their data appears. In that situation, use a Chromium-based option.
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.
Option 3: Browsershot with Puppeteer and Chrome
Browsershot exposes Puppeteer/headless Chrome through a PHP API. The Node and Chrome runtime must be installed wherever the conversion runs.
composer require spatie/browsershot
<?php
use SpatieBrowsershotBrowsershot;
Browsershot::url($absoluteUrl)->savePdf($path);
$pdfBytes = Browsershot::url($absoluteUrl)
->showBackground()
->format('A4')
->pdf();
Browsershot can consume HTML instead of a URL and supports backgrounds, tagged PDFs, orientation, scaling, and page ranges. Configure the Chrome executable and Node environment consistently between development, workers, and production; a controller that works on a laptop can fail in a minimal PHP container that lacks those binaries.
Option 4: Gotenberg as a Chromium service
Gotenberg keeps Chromium outside the Symfony process. Its URL endpoint is /forms/chromium/convert/url; its HTML endpoint accepts an index.html file and optional assets at /forms/chromium/convert/html. A Symfony service can call it with HttpClient:
Recommended Free Tools
<?php
use SymfonyContractsHttpClientHttpClientInterface;
final class PdfRenderer
{
public function __construct(
private HttpClientInterface $httpClient,
private string $gotenbergUrl,
) {}
public function fromUrl(string $absoluteUrl): string
{
$response = $this->httpClient->request(
'POST',
rtrim($this->gotenbergUrl, '/') . '/forms/chromium/convert/url',
['body' => ['url' => $absoluteUrl]]
);
return $response->getContent();
}
}
Gotenberg documents waits for a CSS selector or network-idle state, printing backgrounds, page ranges, failure handling for missing resources, and outbound URL filtering. Those controls are useful when a page fills its table with JavaScript or when you must prevent conversion requests from reaching arbitrary destinations. Its PHP client also documents a Symfony Bundle option.
When to submit HTML instead of a URL
Use the HTML-upload endpoint when the document is private, assembled from local files, or should not be exposed as a publicly reachable route. Include only the assets the renderer needs. For authenticated pages, do not place long-lived credentials in a user-controlled URL; create a deliberate authentication path or prepare the HTML server-side.
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.
Assets, JavaScript, and security
Make CSS, images, and fonts deterministic
- Use absolute, reachable asset URLs for URL-based conversion.
- Check that the conversion host can resolve DNS, establish TLS, and reach the asset origin.
- Bundle local assets where practical and verify font licensing and format support.
- Do not assume a successful HTTP 200 means every image or stylesheet loaded; inspect the generated PDF.
Handle JavaScript explicitly
Symfony’s BrowserKit HttpBrowser is entirely written in PHP and does not support JavaScript or other advanced browser features. HttpClient has the same fundamental limitation for rendering. Fetching a page and converting the returned source therefore misses client-rendered content. Use a selector wait or network-idle wait in Chromium, and give the page a bounded delay only when the application has no reliable readiness selector.
Protect the server-side fetch boundary
PDF conversion is a server-side request on behalf of an application. Validate destinations, restrict credentials, and prevent user-controlled URLs from probing internal services. Gotenberg’s outbound URL filtering is designed for this boundary; review it before accepting arbitrary URLs. Dompdf’s remote-resource setting should remain off unless required, and local-file access should remain constrained.
Operational notes: reliability, speed, and cost
- Reliability: Pin the renderer version and exercise representative pages after upgrades. Browser engines, fonts, and system libraries can change pagination.
- Timeouts: Set an application timeout that exceeds the expected page load but is finite. Return a useful error instead of holding a web request forever.
- Concurrency: Queue large or user-triggered batches so browser processes do not exhaust web workers. Reuse a separate Gotenberg service when isolating Chromium is preferable.
- Caching: Cache PDFs only when the underlying data and authorization permit it. Include the document version or last-modified value in the cache key.
- Observability: Log the engine, target identifier, elapsed time, and failure category without logging document secrets or authorization headers.
- Cost: Dompdf has no separate browser service but uses PHP CPU and memory. Browsershot adds Node/Chrome operations. Gotenberg adds a service to run and monitor. There are no benchmark figures here; measure your own templates and concurrency.
Troubleshooting common failures
The PDF is unstyled
Cause: relative asset URLs or an unreachable origin. Fix: generate an absolute URL, confirm DNS and TLS from the conversion host, or submit self-contained HTML and assets.
Images or fonts are missing
Cause: remote fetching is disabled, cURL/URL wrappers are unavailable, or the asset requires authentication. Fix: enable Dompdf remote resources only when needed, satisfy its PHP transport requirement, and provide a renderer-accessible asset path.
JavaScript content is absent
Cause: BrowserKit or HttpClient fetched source HTML without executing scripts, or wkhtmltopdf reached the page before modern code completed. Fix: use Browsershot or Gotenberg and wait for a selector or network-idle condition.
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
Flexbox or Grid collapses in Dompdf
Cause: those layout systems are outside Dompdf’s documented support. Fix: add print-specific block/table CSS or switch to Chromium.
The converter cannot reach a private route
Cause: the renderer is a separate process or service without the browser’s cookies and network access. Fix: submit prepared HTML, establish a narrowly scoped authentication mechanism, or place the renderer on an allowed network; never expose broad credentials in a public URL.
Gotenberg rejects a URL or local file
Cause: outbound filtering or the documented rejection of file:// URL conversion. Fix: allow only the required destinations and use the HTML upload endpoint for local documents.
Chrome or wkhtmltopdf works locally but not in production
Cause: the binary, Node runtime, fonts, permissions, or shared libraries are absent in the production image. Fix: install and pin the runtime in the deployment image, expose its path through configuration, and run a smoke-test conversion during deployment.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Or skip the browser setup
ScreenshotNeo is a hosted website screenshot API that can return a PDF from one GET request, so Symfony does not need a local browser binary. The service accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the page verdict and billing result in X-Page-Verdict and X-Billed headers.
For a Symfony integration, call the endpoint from a service or command:
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.
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 PDF parameters and the other capture options. The same endpoint can be called from PHP:
<?php
use SymfonyContractsHttpClientHttpClientInterface;
$response = $client->request('GET', 'https://api.screenshotneo.com/v1/shot', [
'query' => [
'access_key' => $_ENV['SCREENSHOTNEO_API_KEY'],
'url' => 'https://stripe.com',
'format' => 'pdf',
],
'timeout' => 90,
]);
file_put_contents($path, $response->getContent());
ScreenshotNeo also provides an MCP server with take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. It includes 1,000 screenshots per month free with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account to get an access key.
Testing the integration
Test each template with real data and assert both the HTTP contract and the document content. At minimum, verify a 200 response, application/pdf content type, a non-empty body, expected page count for representative data, and the presence of critical text or images. Include cases with long tables, missing optional fields, non-ASCII text, slow JavaScript, and inaccessible assets. Run the same smoke tests in the production-like container or conversion service, not only in a developer workstation.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Frequently Asked Questions
Can I generate a PDF asynchronously in Symfony?
Yes. Put the rendering service behind a Messenger message or another queue, store the resulting bytes in durable storage, and notify the requester when the job finishes. Keep the same URL, asset, timeout, and authorization safeguards as a synchronous action.
How can I offer both an inline preview and a download?
Return the same PDF bytes with different Content-Disposition values: inline for browser preview and attachment for download. Use a safe, deterministic filename and do not derive it directly from untrusted input.
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.

