Use DocRaptor’s HTTP API from a Node.js server: send HTML (or a page URL) to https://api.docraptor.com/docs, then handle the successful response as PDF bytes. Save those bytes to a file or return them to a browser. Keep your API key on the server, use test mode while developing, and switch to asynchronous generation if a job may exceed DocRaptor’s documented 60-second synchronous limit.
Choose HTML content or a hosted URL
DocRaptor accepts either HTML you supply or a URL for it to retrieve. Use supplied content when your application generates or controls the markup; use a URL when the source is already hosted and accessible to DocRaptor. The vendor’s Node.js guide documents both approaches. DocRaptor Node.js guide
| Input | Use it when | Asset handling |
|---|---|---|
document_content |
Your server has the HTML string or creates it dynamically. | Use absolute asset URLs, or set a base URL so relative CSS and image paths can resolve. |
document_url |
The HTML is already available at a URL DocRaptor can retrieve. | Ensure the page and its required assets are accessible to the renderer. |
The API examples on DocRaptor’s pages use slightly different request shapes. Follow the field names for the specific API example you adopt and verify them against the current API reference before production use.
Generate and save a PDF in Node.js
DocRaptor’s official Node.js tutorial demonstrates Axios. Install it with npm install axios, then put the following in a server-side Node.js file. Set DOCRAPTOR_API_KEY in your server environment before running it. This example submits HTML content, enables test mode, and writes a successful binary response to output.pdf.
#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.
const axios = require('axios');
const fs = require('fs');
async function createPdf() {
const html = '<!doctype html><html><body><h1>Hello, PDF</h1></body></html>';
const response = await axios.post(
'https://api.docraptor.com/docs',
{
user_credentials: process.env.DOCRAPTOR_API_KEY,
doc: {
document_content: html,
name: 'example.pdf',
type: 'pdf',
test: true
}
},
{ responseType: 'arraybuffer' }
);
fs.writeFileSync('output.pdf', response.data);
}
createPdf().catch((error) => {
if (error.response) {
const message = Buffer.from(error.response.data).toString('utf8');
console.error('DocRaptor returned HTTP', error.response.status, message);
} else {
console.error(error.message);
}
process.exitCode = 1;
});
This follows the vendor’s Node.js/Axios example pattern; check the Node.js guide and API reference for current field details. The important response setting is arraybuffer: a successful PDF is binary data, not ordinary UTF-8 text. Only decode a response body as text on the error path, since an API error may be returned as XML with a non-success status. DocRaptor API overview
Use a URL instead of an HTML string
Replace document_content with document_url in the document object when you want DocRaptor to retrieve a hosted page. Check that the URL is reachable by the service and that any resources the page needs can be loaded.
Resolve relative assets in supplied HTML
If the HTML uses paths such as /styles/report.css or images/chart.png, provide an appropriate base URL through the documented prince_options.baseurl option or use absolute asset URLs. Without a resolvable base, relative paths may not point to the intended files. DocRaptor Node.js guide API reference
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.
Return the PDF from an application route
For a web endpoint, keep the same binary response handling, then send the bytes with PDF headers rather than converting them to text. With an Express-style response object, the final delivery step is:
Recommended Free Tools
res.setHeader('Content-Type', 'application/pdf');
res.setHeader('Content-Disposition', 'inline; filename="report.pdf"');
res.status(200).send(response.data);
Use attachment instead of inline in Content-Disposition if the browser should download the file. Your route should handle DocRaptor errors separately and avoid sending a partial or error body with a PDF content type. The API overview describes saving the binary response on a server or sending it to a browser. DocRaptor API overview
Protect credentials and use test mode deliberately
Keep the API key server-side
Load the credential from an environment variable or secret store. Do not put it in browser JavaScript, public HTML, or a client-side bundle: anyone who can inspect that code could obtain the key. DocRaptor Node.js guide
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.
Develop with watermarked test PDFs
Set test: true while building and validating your integration. Test PDFs are watermarked and should not be treated as production output. DocRaptor’s API reference says test documents are unlimited across plans and do not count toward monthly limits. For hosted test documents, that reference currently specifies five downloads and a one-day expiry; confirm the live terms before relying on those limits. DocRaptor API reference
Enable JavaScript only when the HTML needs it
JavaScript processing is disabled by default. Static HTML does not need it. Enable the appropriate engine only when the document depends on JavaScript-generated content, such as a chart rendered after page load. DocRaptor documents its own JavaScript engine for common JavaScript support and a separate Prince engine for cases that need Prince-specific capabilities. Both are off by default; enabling both may execute code twice. DocRaptor JavaScript documentation API reference
When enabling JavaScript, configure the setting documented for the engine you intend to use, then test the resulting PDF with representative content. Do not enable both engines by default.
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
Choose synchronous, asynchronous, or hosted output
| Mode | What your application receives | When it fits |
|---|---|---|
| Synchronous | PDF bytes in the response. | Jobs expected to finish within the documented 60-second time limit. |
| Asynchronous | A status identifier; retrieve the result after processing. | Jobs that may take longer than the synchronous limit. |
| Hosted | A URL for the generated document. | When you want DocRaptor-hosted output rather than managing direct delivery of the PDF bytes. |
DocRaptor’s API reference documents a 60-second synchronous generation limit. For longer-running work, use the asynchronous flow and poll or retrieve the output using the returned status identifier as described in the API documentation. Hosted document creation is a separate option and returns a URL. DocRaptor API reference DocRaptor API overview
Check the rendering pipeline when PDFs change
DocRaptor’s API reference lists Pipeline 10.1 as the default and maps it to Prince 15.1 and JavaScript engine 2. This is a live-reference detail, not a permanent guarantee; check the current reference when diagnosing output or configuring a pipeline. DocRaptor’s release note dated 2023-06-02 describes the introduction of Pipelines 10 and 10.1 and warns that pipeline changes can be breaking, recommending that documents be tested before upgrading. DocRaptor API reference DocRaptor release notes
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshoot common PDF-generation failures
- The saved file is not a valid PDF: Confirm the request succeeded and that the HTTP client uses binary response handling such as Axios
arraybuffer. Do not decode or re-encode a successful PDF response as text. - The output contains an error message or XML: Check the HTTP status before writing the body as a PDF. On a non-success response, decode the error body for diagnosis instead of returning it with
application/pdf. - CSS or images are missing: Replace relative references with absolute URLs or set the documented base URL for the supplied HTML. Confirm the renderer can access the assets.
- Dynamic content is absent: JavaScript rendering is off by default. Enable the appropriate documented engine only if the page requires generated content, and verify the engine choice.
- A long job times out: The synchronous endpoint is documented with a 60-second limit. Use asynchronous generation for work that may exceed it.
- The PDF has a watermark: The request may still be in test mode. Use
test: falsefor production output after validating the integration. - The API key is exposed: Remove it from client-side code, rotate it if it was publicly exposed, and move requests to a server-side route that reads a secret from server configuration.
Or skip the browser setup
If your task is to capture a webpage as an image or PDF rather than render a designed HTML document with DocRaptor, ScreenshotNeo accepts one GET request with a URL. For a screenshot as a WebP file:
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →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
ScreenshotNeo API documentation
- Cookie and consent banners, newsletter popups, and chat widgets are removed before capture; each step can be turned off.
- Bot checks and CAPTCHAs, blank pages, failed loads, timeouts, and cache hits are not billed; the response reports the page verdict and billing status.
- An MCP server gives AI agents tools to take screenshots, inspect page information, and capture PDFs.
- The free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000.
Sign up for ScreenshotNeo’s free plan.
Frequently Asked Questions
Can DocRaptor generate a PDF from a URL instead of an HTML string?
Yes. Use the documented document_url field when DocRaptor should retrieve a hosted page.
Does DocRaptor test mode produce an unwatermarked PDF?
No. Test PDFs are watermarked; use test mode for development rather than production output.
Does static HTML require JavaScript rendering?
No. JavaScript processing is disabled by default and is only needed when the document depends on JavaScript-generated content.
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.
Free tools Windows power users keep installed
One-click scans. No signup required.

