Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk9 min

How to Use DocRaptor to Generate Bulk Payslip PDFs in India

A practical guide to creating one DocRaptor PDF per employee and pay period, testing print output, handling batch failures, and checking Indian wage-slip obligations.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use DocRaptor as a server-side PDF renderer: prepare one employee-specific HTML document for each approved payroll record, submit one document request per payslip, and securely associate each returned PDF with the right employee and pay period. The API creates documents; it does not calculate wages or determine whether a payslip complies with Indian requirements. The DocRaptor API reference describes document-level requests, not a universal bulk endpoint or guaranteed throughput, so build bulk processing in your own queue and confirm account limits before choosing concurrency.

How bulk payslip generation works

In this workflow, “bulk” means processing a payroll run containing many separate payslips. Treat every employee-and-period combination as its own document job unless your verified account and integration support another documented pattern.

As an Amazon Associate I earn from qualifying purchases.

  1. Approve payroll data. Obtain finalized records from your payroll system; do not calculate or alter wages in the PDF-rendering step.
  2. Render a payslip template. Populate an employee-specific HTML document with that record’s values, using safe HTML escaping for every data field.
  3. Queue one job per payslip. Give each job a stable employee/pay-period identifier and track its status independently.
  4. Submit from a server-side worker. Send a POST request to https://api.docraptor.com/docs with the API key kept on the server.
  5. Store and verify the result. Save returned PDF bytes in an access-controlled location, then record success or failure against the matching job before delivery.

DocRaptor’s document API supports HTML/XML content or a document URL. A successful synchronous PDF request returns PDF bytes; hosted-document and asynchronous workflows are also documented, with a URL or status identifier used to obtain the result. The PDF response includes an X-DocRaptor-Num-Pages header. Choose the response style that suits your worker and storage design rather than assuming every request returns the same kind of result.

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

Prepare a payslip template for print

Build for the PDF rendering environment

DocRaptor converts HTML to PDF using Prince. Print media is applied by default, so write and inspect print CSS rather than assuming the page will look like a browser screen. The API reference describes prince_options.media for cases where you intentionally need a different media mode. JavaScript is disabled by default; leave it off unless the template genuinely depends on client-side rendering. The documentation notes that documents that do not need JavaScript process faster without it. If your template uses asynchronous JavaScript, follow DocRaptor’s documented completion-callback mechanism.

#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)

Pipeline 10.1 is documented as the default for accounts on DocRaptor’s newest pipeline; earlier choices map to different Prince and JavaScript engine versions. Check the active setting for your account. If repeatable rendering is important, pin a supported pipeline and validate output again before changing it.

Make data and assets predictable

  • Escape employee names, addresses, and other variable text for HTML before inserting it into a template. Do not concatenate untrusted values into markup.
  • Keep labels and values together in the layout, and test long names, varied deductions, multilingual characters, and amounts that cause line wrapping.
  • Use stable fonts, stylesheets, and images. DocRaptor’s API reference says external CSS and image-resource errors are ignored by default and resources may be fetched for up to ten seconds. A request can therefore succeed while an asset is missing; consider embedding dependable assets or configuring strict resource-error handling, and inspect the PDF.
  • Validate rounding and the presentation of negative, zero, or unusually large values against the approved payroll record and your payroll rules.

Example: submit one payslip request from Python

This example shows the core synchronous request pattern. It reads a single approved record from environment variables, escapes values for HTML, sends one PDF request, and writes the returned bytes to a local file. Install the dependency with python -m pip install requests; set DOCRAPTOR_API_KEY on the server before running it. The local output path is for illustration: production systems should use an access-controlled store and a job-to-document record.

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
import os
from decimal import Decimal
from html import escape
from pathlib import Path

import requests

api_key = os.environ["DOCRAPTOR_API_KEY"]
employee_id = os.environ["EMPLOYEE_ID"]
employee_name = os.environ["EMPLOYEE_NAME"]
pay_period = os.environ["PAY_PERIOD"]
gross_pay = Decimal(os.environ["GROSS_PAY"])
deductions = Decimal(os.environ["DEDUCTIONS"])
net_pay = gross_pay - deductions

# Escape every value inserted into HTML; retain only trusted template markup.
html = f"""<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <style>
    @page {{ size: A4; margin: 18mm; }}
    body {{ font: 12pt Arial, sans-serif; color: #222; }}
    h1 {{ font-size: 18pt; }}
    .amount {{ text-align: right; }}
    table {{ width: 100%; border-collapse: collapse; }}
    th, td {{ padding: 8px; border-bottom: 1px solid #ccc; }}
  </style>
</head>
<body>
  <h1>Payslip</h1>
  <p>Employee: {escape(employee_name)}</p>
  <p>Employee ID: {escape(employee_id)}</p>
  <p>Pay period: {escape(pay_period)}</p>
  <table>
    <tr><th>Item</th><th class="amount">Amount</th></tr>
    <tr><td>Gross pay</td><td class="amount">{gross_pay:.2f}</td></tr>
    <tr><td>Deductions</td><td class="amount">{deductions:.2f}</td></tr>
    <tr><td>Net pay</td><td class="amount">{net_pay:.2f}</td></tr>
  </table>
</body>
</html>"""

response = requests.post(
    "https://api.docraptor.com/docs",
    auth=(api_key, ""),  # API key as HTTP Basic username; blank password
    json={
        "type": "pdf",
        "document_content": html,
        "name": f"payslip-{employee_id}-{pay_period}",
        "test": True,
    },
    timeout=120,
)
response.raise_for_status()

# Test-mode PDFs are watermarked; do not distribute this output as a final slip.
Path("payslip-test.pdf").write_bytes(response.content)
print("Pages:", response.headers.get("X-DocRaptor-Num-Pages", "not supplied"))

The request uses HTTP Basic Authentication with the API key as the username and an empty password, which DocRaptor’s documentation prefers for direct REST requests. The API also documents query-parameter authentication, but avoid placing secrets in URLs where logs or monitoring might record them. The example uses the documented PDF type and HTML document-content pattern; adapt the HTML to your approved payslip design and confirm the active account settings.

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

Test mode and production mode

In the example, test is set to true. DocRaptor’s API reference says test documents do not count against monthly limits, but test PDFs are watermarked. Hosted test documents have a five-download limit and expire after one day. They are useful for rendering checks, not for distributing final employee records. Validate realistic records in test mode, then use production mode and your live account settings for final documents.

Rank #3
Sale
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.

Scale the request into a payroll batch

For a payroll run, wrap the single-document operation in a durable queue rather than creating one giant document. A practical design is an engineering pattern based on DocRaptor’s document-level API, not a vendor-published bulk recipe.

  1. Freeze the input set. Use a payroll-run identifier and a stable key for each employee and pay period. Pull only approved records.
  2. Create one job per PDF. Store the job key, employee record reference, period, attempt count, and state separately from the PDF contents.
  3. Render and submit in a worker. Keep requests out of browser code. Limit concurrent jobs conservatively until you have confirmed account limits and measured behavior for your workload.
  4. Handle outcomes per job. Store a successful PDF with its job key. On errors or timeouts, record the failure and retry only after checking whether the first attempt completed; do not assume the service guarantees idempotency.
  5. Reconcile before delivery. Compare the completed job set against the approved payroll roster and period, and investigate missing, duplicated, or mismatched files.
  6. Deliver with authorization checks. Authenticate the employee in your payroll application and verify their access to the requested payslip. Never treat a client-supplied employee ID alone as authorization.

DocRaptor’s sources do not establish universal concurrency settings, per-minute throughput, queue design, or an idempotency guarantee. Benchmark and confirm the service limits for the actual account before setting batch size. Avoid logging salary data or exposing unrestricted download links; the cited DocRaptor materials do not define an India-specific access-control scheme, so those protections belong in your application.

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

What the Indian wage-slip rules say

Rule 52 of the Ministry of Labour and Employment’s Code on Wages Central Rules states: “Every employer shall issue wage slips, electronically or in physical form to the employees in Form V under sub-section (3) of section 50 on or before payment of wages.” Rule 51(4) says registers required under those rules are preserved for five years after the date of the last entry.

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.

These are statements in the cited central rules, not a complete legal analysis for every employer, worker, or state. Confirm the applicable Code, rules, forms, commencement position, and state-specific requirements with a qualified compliance adviser before treating a generated document or retention process as compliant. DocRaptor renders the supplied document; it does not calculate wages or validate the legal accuracy of a Form V or payroll record.

Best Value
HP LaserJet M110w | Monochrome | Laser Printer | Fast Black-and-White Printing | Mobile Printing | Wireless Printing | Fast Printing
  • 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
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common failures

Symptom Likely cause What to check or do
Authentication is rejected Missing or incorrect API key, malformed Basic Authentication, or key exposed in the wrong environment. Confirm the server has the intended key, use it as the Basic username with a blank password, and keep it out of browser JavaScript. DocRaptor warns its JavaScript library exposes the key in page source.
The PDF is present but looks like a screen layout Print CSS differs from screen CSS, or the template assumes browser media. Inspect the print stylesheet and page breaks. Print media is the default; use prince_options.media only if a different media mode is intentional.
Content is missing or cut off Unexpected line wrapping, a long field, a page-break issue, or an asset that failed to load. Reproduce with the affected record in test mode, inspect page count and output, then adjust print CSS or asset handling. An HTTP success alone does not prove the rendered document is complete.
Dynamic template content is absent JavaScript is disabled by default. Prefer generating complete HTML on the server. Enable JavaScript only if needed and use DocRaptor’s documented callback mechanism for asynchronous scripts.
Batch has partial results Some document jobs failed or timed out independently. Track state per employee and period, reconcile against the payroll roster, and retry only after determining whether a prior request completed.
A test PDF reached an employee Test output was mistaken for production output. Test PDFs are watermarked. Separate test and production storage/delivery paths and block distribution of test artifacts.

Performance, reliability, and cost decisions

  • Throughput: no universal bulk concurrency or per-minute rate is established by the cited API materials. Validate limits for your account, then measure representative documents and ramp concurrency cautiously.
  • Reliability: make each payslip job independently observable, preserve errors, and reconcile completed documents before delivery. Do not assume retries are idempotent.
  • Rendering speed: avoid enabling JavaScript for static templates; DocRaptor says processing is faster when JavaScript is not required.
  • Correctness: test the most complex expected layouts and check page count, multilingual text, fonts, image loading, and totals against approved source data.
  • Cost planning: test documents are stated not to count against monthly limits. The material cited here does not establish current production pricing, account allowances, or a cost per payslip, so check the live account terms before forecasting a payroll run.
  • Privacy: minimize salary data in logs, secure stored PDFs, and apply recipient authorization in your own application.

Or skip the browser setup

ScreenshotNeo is a website screenshot API, not a payslip-PDF generator or a replacement for the DocRaptor workflow above. It may suit a separate task such as capturing a non-sensitive, publicly accessible payroll-demo page for visual QA; do not send employee salary data to a screenshot endpoint. Its screenshot endpoint accepts a URL and returns an image or PDF. The example below captures a public demo URL; see the ScreenshotNeo API documentation for the request details.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
  • Cookie banners, popups, and chat widgets are removed before the shot, with each step able to be turned off.
  • Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed.
  • An MCP server lets AI agents use its screenshot tools.
  • 1,000 screenshots a month are free with no card; paid plans start at $5 for 3,000.

For that separate screenshot use case, see ScreenshotNeo and sign up free for 1,000 screenshots a month with no card.

Frequently Asked Questions

Can DocRaptor calculate gross pay, deductions, or net pay?

No. It renders the HTML or URL supplied to it; payroll calculation and validation must happen in your payroll system.

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

Can I send a payslip directly from a browser using DocRaptor’s JavaScript library?

DocRaptor warns that its JavaScript library exposes the API key in page source. Use a server-side worker or another documented arrangement that does not expose the key publicly.

Does successful PDF generation prove a payslip meets Indian legal requirements?

No. Rendering does not validate payroll figures, Form V content, or which rules apply to a particular employer and employee group.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.