---
type: WebPage
title: "wkhtmltopdf for Node.js and Go: executable replacement | Marqius"
description: Keep Node.js and Go wrappers that launch wkhtmltopdf. Point the
  command to Marqius, then check streams, exit codes and your own PDFs.
resource: https://marqius.com/wkhtmltopdf/node-go/
tags:
  - marqius
  - products-and-guides
status: stable
sources:
  - id: official-page
    resource: https://marqius.com/wkhtmltopdf/node-go/
generated:
  by: process:marqius-site-build
  at: 2026-11-20T10:17:10.036Z
x_marqius:
  language: en
  source_sha256: dd555102b30c3b4914c633bd54c2214500a3d043ad710f6f34dc7e53d8bc7470
  extraction: public-main-content
---

NODE.JS · GO · COMMAND-LINE WRAPPERS

# Keep the wrapper.  
_Swap the program._

If your package starts wkhtmltopdf, Marqius can take that executable name. Keep the calling code and test its output stream and error handling.

```
curl -fsSL https://marqius.com/marqius-wkhtmltopdf.sh | bash
```

[Start your 30-day trial](https://marqius.com/app/sign-in/?plan=trial) [Download switching manual](https://marqius.com/download/replace-wkhtmltopdf.pdf)

wkhtmltopdf (current) Marqius (drop-in)

**A simple, drop-in migration** Keep your Node & Go workflow Install in minutes Compare your own PDFs

1

### Install

Install the compatible program alongside your current wkhtmltopdf.

```
curl -fsSL https://marqius.com/marqius-wkhtmltopdf.sh | bash
```

2

### Node.js

Keep your calling code and update the executable path.

```
const wkhtmltopdf = require("wkhtmltopdf");
wkhtmltopdf.command = "/usr/local/bin/wkhtmltopdf";
wkhtmltopdf(html, { pageSize: "A4" }).pipe(fs.createWriteStream("report.pdf"));
```

3

### Compare output

Render a representative document and check the PDF before switching production.

```
marqius wkhtmltopdf invoice.html new.pdf
marqius compare old.pdf new.pdf
```

**Switching manual**

Examples and troubleshooting for Node & Go and related stacks.

[Download the manual (PDF)](https://marqius.com/download/replace-wkhtmltopdf.pdf)[Developer manual (PDF)](https://marqius.com/download/developer-manual.pdf)[Getting started guide (PDF)](https://marqius.com/download/getting-started.pdf)[14 integration examples on GitHub](https://github.com/marqius-wkhtmltopdf/marqius-wkhtmltopdf-examples)

[Start your 30-day trial](https://marqius.com/app/sign-in/?plan=trial)

PRACTICAL DETAILS

## What to check before you switch.

### Go

```
wkhtmltopdf.SetPath("/usr/local/bin/wkhtmltopdf")
pdfg, _ := wkhtmltopdf.NewPDFGenerator()
pdfg.AddPage(wkhtmltopdf.NewPageReader(strings.NewReader(html)))
_ = pdfg.Create()
```

### Other command-line callers

Exercise standard input/output, page options and the exit status your application expects. Use the switching manual as a checklist.

Marqius is proprietary software from Simple AI LLC. It is independent of the wkhtmltopdf project. Other product names identify the tools discussed in these guides.

QUESTIONS & ANSWERS

## Node & Go questions

### Do I have to replace my Node.js or Go package?

Usually no if it starts a wkhtmltopdf executable. Configure the path to the installed compatible program where your package pins one.

### Can my application stream the PDF?

Test the standard input and output path your application already uses, including error handling and exit status.

### Will the same command work in CI?

Install the correct Linux build and the fonts used by your templates in the runner, then render and compare a test document.

### What if a package loads libwkhtmltox instead of a program?

An executable replacement will not work for a direct native-library binding. That integration needs a separate adapter.

Source for this page [^official-page].

[^official-page]: https://marqius.com/wkhtmltopdf/node-go/

[Browse this section](index.md) · [Knowledge index](../index.md)
