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

Use DocRaptor to generate bulk payslips by having a server-side job submit one HTML-based PDF request per employee and pay period, then securely store and deliver each returned file. DocRaptor creates the PDFs; your payroll system must supply the correct wage data, apply the right access controls, and determine which Indian wage-slip rules apply.

How bulk payslip generation works

DocRaptor’s document API accepts a POST request containing HTML or a URL and returns a PDF. For bulk payroll, treat each employee’s payslip for each pay period as a separate document request unless your verified integration and account support another pattern. The documented API does not establish a universal bulk endpoint, concurrency limit, or throughput guarantee.

  1. Fetch the approved payroll records for a pay period.
  2. Render a separate, employee-specific HTML document for each record.
  3. Enqueue one PDF-generation task per document and submit tasks from a server-side worker.
  4. Associate each response with a stable employee and pay-period identifier, then save the PDF in access-controlled storage.
  5. Record success or failure per document and provide a controlled retry path.

This is an application architecture based on DocRaptor’s document-level API, not a vendor-prescribed bulk recipe. Confirm account-specific service limits and benchmark the expected batch before setting worker concurrency or schedule.

Prepare the payslip data and template

Keep payroll data authoritative

Read finalized payroll records from the system of record; do not calculate or alter wages in the PDF-generation step. Pass only the fields the payslip needs, such as employee details, pay period, earnings, deductions, and net pay. The template should display the approved values consistently, including currency, dates, and rounding.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Brother DCP-L2640DW Wireless Compact Monochrome Multi-Function Printer, Copy, Scan, Duplex, Mobile Printing
  • BEST FOR SMALL BUSINESSES – Engineered for extraordinary productivity, the Brother DCP-L2640DW Monochrome (Black & White) 3-in-1 combines laser printer, scanner, copier in one compact footprint and delivers high-quality black & white prints
  • FAST PRINTER WITH EFFICIENT SCANNING – Produces documents quickly with print speeds up to 36 ppm(2) and scan speeds up to 23.6/7.9 ipm(3) (black/color). A 50-page auto document feeder(4) allows for convenient, time saving multi-page scanning and copying
  • FLEXIBLE CONNECTION OPTIONS – Easily navigate the changing demands of your business with secure multi-device connectivity via built-in dual-band wireless (2.4GHz / 5GHz) and Ethernet. Or connect locally to a single computer via USB interface
  • BROTHER MOBILE CONNECT APP – Print, scan, and manage your wireless printer anytime, from almost anywhere from your mobile device. Order Brother Genuine Supplies, track toner usage, and complete more work on-the-go(5)
  • CHOOSE BROTHER GENUINE TONER – When it’s time to replace your toner, be sure to choose Brother Genuine TN830 or TN830XL replacement toner. And with Refresh EZ Print Subscription Service, you’ll never worry about running out of toner again and you’ll enjoy savings of up to 50%(6) on Brother Genuine Toner. Get started with Refresh today with a Free Trial(1)

Render one document per recipient

Escape data before inserting it into HTML. The example below uses Python’s standard HTML escaping for text values. If values are inserted into attributes, URLs, CSS, or script contexts, use escaping appropriate to that context or avoid placing untrusted data there. Never concatenate arbitrary payroll input into executable JavaScript.

Design for print

DocRaptor converts HTML to PDF using Prince, and print media is applied by default. Build the stylesheet for print output and check page breaks, margins, font availability, and long or multilingual names. Use the API’s prince_options.media only if you deliberately need a different media mode. JavaScript is disabled by default; leave it off unless the template truly requires client-side rendering.

Submit requests from a server-side worker

The following Python example reads a CSV containing finalized payroll fields, creates one HTML document per row, posts each request to DocRaptor, and saves the returned PDF bytes. It processes records sequentially so it does not assume an undocumented concurrency allowance. Install the dependency with python -m pip install requests, set DOCRAPTOR_API_KEY in the worker environment, and provide a CSV with the column names shown in the code.

Rank #2
Brother HL-L2405W Wireless Compact Monochrome Laser Printer with Mobile Printing, Black & White Output | Includes Refresh Subscription Trial(1), Works with Alexa
  • BEST FOR HOMES & HOME OFFICES – Engineered for consistent, premium print quality, the Brother HL-L2405W Monochrome (Black & White) Laser Printer delivers sharp, crisp prints at an affordable price. Prints one-sided documents at speeds up to 30ppm(2)
  • COMPACT, CONNECTED PRINTER – Flexible connection options make this an ideal printer for home use and at-home offices. Securely connect to multiple devices with built-in dual-band wireless (2.4GHz/5GHz) or locally to a single computer via USB interface
  • BROTHER MOBILE CONNECT APP – Manage your printer remotely and print from your mobile device anytime, from almost anywhere. Order Brother Genuine Supplies, track toner usage, and complete more work on-the-go(3)
  • VERSATILE PAPER HANDLING – Enjoy seamless, reliable everyday printing with the 250-sheet paper tray(4) and a manual feed slot that enables printing on envelopes and specialty pape
  • BROTHER IS AT YOUR SIDE – Backed by Brother with a 1-year limited warranty and free online, call, or live chat support for the life of your printer

The request uses HTTP Basic Authentication with the API key as the username and a blank password, and sets test to true. DocRaptor test PDFs are watermarked; do not distribute them as final payslips. After validating output, switch the setting to production according to your account configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import csv
import html
import os
import re
from pathlib import Path

import requests

API_URL = "https://api.docraptor.com/docs"
API_KEY = os.environ["DOCRAPTOR_API_KEY"]
INPUT_CSV = Path("payroll.csv")
OUTPUT_DIR = Path("payslips")
TEST_MODE = True  # Test PDFs are watermarked; use production mode only after validation.

OUTPUT_DIR.mkdir(mode=0o700, parents=True, exist_ok=True)


def safe_filename(value):
    cleaned = re.sub(r"[^A-Za-z0-9_-]+", "_", value).strip("_")
    return cleaned or "employee"


def make_html(row):
    # These values are inserted as text, so escape HTML metacharacters.
    fields = {key: html.escape(row[key], quote=True) for key in (
        "employee_id", "employee_name", "pay_period", "gross_pay",
        "deductions", "net_pay"
    )}
    return f"""
Payslip {fields['pay_period']}

Payslip

Employee: {fields['employee_name']} ({fields['employee_id']})

Pay period: {fields['pay_period']}

Gross pay{fields['gross_pay']}
Deductions{fields['deductions']}
Net pay{fields['net_pay']}
""" with INPUT_CSV.open(newline="", encoding="utf-8") as source: for row in csv.DictReader(source): employee_id = row["employee_id"] pay_period = row["pay_period"] document_name = f"payslip-{safe_filename(employee_id)}-{safe_filename(pay_period)}.pdf" payload = { "document_type": "pdf", "document_content": make_html(row), "name": document_name, "test": TEST_MODE, } response = requests.post( API_URL, auth=(API_KEY, ""), json=payload, timeout=90, ) response.raise_for_status() output_path = OUTPUT_DIR / document_name with output_path.open("wb") as pdf_file: pdf_file.write(response.content) print(f"Saved {output_path} ({response.headers.get('X-DocRaptor-Num-Pages', 'page count not returned')} pages)")

The API reference is at https://api.docraptor.com/docs. A synchronous success returns PDF binary data; the response includes an X-DocRaptor-Num-Pages header. If using hosted documents or asynchronous requests instead, implement the corresponding download or status-retrieval flow rather than treating the initial response as PDF bytes.

Rank #3
Canon imageCLASS LBP6030w - Monochrome Single-Function Wireless Compact Wireless Laser Printer, 1 Year Limited Warranty, 19 PPM, White - Print Only
  • FAST PRINT SPEEDS: Print up to 19 pages per minute.
  • COMPACT DESIGN: Space-saving, compact design fits anywhere in your home, school or small office.
  • WIRELESS CONNECTIVITY: Print from almost anywhere in your workspace using your compatible mobile device.
  • PAPER CAPACITY: Up to 150 sheets.
  • SUSTAINABILITY: Uses less than 2 watts in Energy Saver mode.

Use a durable queue for production

The sequential example is intentionally simple. In a production payroll application, create a job per payslip and track states such as queued, submitted, completed, and failed. Store enough metadata to connect a result to the intended employee and period without logging salary details. Before retrying a failed job, check whether the first attempt produced a usable document; the cited API material does not establish an idempotency guarantee that would make duplicate submissions safe by default.

Secure the PDFs and API key

  • Keep the API key on the server. DocRaptor warns that its JavaScript library exposes the key in public page source; use a server-side agent or an appropriate referrer-based API instead.
  • Authenticate a user against the payroll application’s records before allowing access to a payslip. Do not treat a client-supplied employee ID as proof of authorization.
  • Save returned bytes to access-controlled storage and use authenticated downloads. Avoid public links for salary documents.
  • Keep salary values, API keys, and complete rendered HTML out of routine logs. Log job identifiers and limited error details instead.
  • Set retention and deletion policies for generated documents and temporary files that fit the organization’s payroll and privacy obligations.

These access-control measures are prudent application design; DocRaptor’s API does not define an Indian payroll authorization model.

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

Test rendering before a payroll run

DocRaptor test mode does not count test documents against monthly limits, but test PDFs are watermarked. Hosted test documents have a five-download limit and expire after one day. Use test mode to validate representative records, then verify a production-mode document and account settings before sending payslips to employees.

Rank #4
Brother HL-L2460DW Wireless Compact Monochrome Laser Printer with Duplex, Mobile Printing, Black & White Output | Includes Refresh Subscription Trial(1), Works with Alexa
  • BEST FOR HOME OFFICES & SMALL TEAMS – Engineered for consistent, premium print quality, the Brother HL-L2460DW Monochrome (Black & White) Laser Printer produces documents that are clear, crisp, and easy to review and share, all at an affordable price
  • COMPACT, CONNECTED, EXCEPTIONALLY EFFICIENT– Connect with built-in dual-band wireless (2.4GHz/5GHz), Ethernet, or to a single computer via USB interface. Prints at speeds up to 36ppm(2), plus automatic duplex printing saves time and reduces paper waste
  • BROTHER MOBILE CONNECT APP – Manage your wireless printer remotely and print from your mobile device anytime, from almost anywhere. Order Brother Genuine Supplies, track toner usage, and complete more work on-the-go(3)
  • VERSATILE PAPER HANDLING – Tackle high-volume black & white printing with the 250-sheet capacity paper tray.(4) The manual feed slot enables printing on envelopes and specialty paper
  • BROTHER IS AT YOUR SIDE – Backed by Brother with a 1-year limited warranty and free online, call, or live chat support for the life of your printer
  • Include long names, multilingual characters, unusually large or small amounts, and differing deductions.
  • Check rounding, currency display, page breaks, and any record that could create a multi-page document.
  • Verify that fonts, logos, and other assets appear. External CSS and image resource errors are ignored by default, and resources may be fetched for up to ten seconds; a successful HTTP response does not by itself prove that the PDF is complete.
  • For stable assets, consider embedding them or configuring stricter resource-error handling, then inspect the output PDF.
  • If the account uses the newest pipeline, the API reference documents Pipeline 10.1 as its default. Earlier pipeline options are also listed. Confirm the live default for the account and pin a pipeline when repeatable rendering matters.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

India wage-slip requirements to verify

Rule 52 of the Ministry of Labour and Employment’s Code on Wages Central Rules says employers covered by the rule must issue wage slips electronically or physically in Form V on or before payment of wages. Rule 51(4) states that registers required under those rules are preserved for five years after the date of the last entry. Applicability depends on the employer, employee group, current commencement position, and relevant jurisdiction; verify the current central and state requirements before treating this as a compliance determination.

DocRaptor generates a PDF from submitted content. It does not calculate wages, validate payroll figures, or decide whether your data and form meet legal requirements.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server, not a payslip PDF generator or payroll system. It may suit a separate task such as capturing a generic, non-sensitive preview page for visual review; do not send employee-specific salary information to it for this purpose. Its API request makes a website screenshot, not a DocRaptor payslip.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
HP LaserJet M110w | Monochrome | Laser Printer
  • FROM AMERICA'S MOST TRUSTED PRINTER BRAND – Perfect for small teams printing professional-quality black & white documents and reports. Perfect for 1-3 people
  • WORLD'S SMALLEST LASER IN ITS CLASS – Precision laser printing that fits anywhere
  • FAST PRINT SPEEDS – Up to 21 black-and-white pages per minute single-sided
  • WIRELESS WITH SELF-RESET – Helps you stay connected
  • PRINT FROM ANY DEVICE – Wireless printing from any mobile device, PC or tablet. Works with Microsoft, Mac, AirPrint, Android, Chromebook and more

For that separate screenshot task, the one-call example is:

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. ScreenshotNeo removes cookie banners, popups, and chat widgets before a shot; bot checks, blank pages, and failed loads are not billed. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000.

Sign up for ScreenshotNeo’s free plan to try the screenshot API.

Frequently Asked Questions

Can I use an Excel or payroll export as the source for these PDFs?

Yes. Import the finalized records into your server-side job, map the required fields into each employee’s HTML template, and submit one document request per payslip.

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

Does a successful DocRaptor response prove the payslip is visually complete?

No. Inspect the returned PDF: external CSS or image failures can be ignored by default, so a request can succeed even when an asset is missing.

Quick Recap

Bestseller No. 3
Canon imageCLASS LBP6030w - Monochrome Single-Function Wireless Compact Wireless Laser Printer, 1 Year Limited Warranty, 19 PPM, White - Print Only
Canon imageCLASS LBP6030w - Monochrome Single-Function Wireless Compact Wireless Laser Printer, 1 Year Limited Warranty, 19 PPM, White - Print Only
FAST PRINT SPEEDS: Print up to 19 pages per minute.; PAPER CAPACITY: Up to 150 sheets.; SUSTAINABILITY: Uses less than 2 watts in Energy Saver mode.
$134.99
Bestseller No. 5
HP LaserJet M110w | Monochrome | Laser Printer
HP LaserJet M110w | Monochrome | Laser Printer
WORLD'S SMALLEST LASER IN ITS CLASS – Precision laser printing that fits anywhere; FAST PRINT SPEEDS – Up to 21 black-and-white pages per minute single-sided

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.