You can generate a PDF from HTML in a PHP application using DocRaptor’s Composer package: install docraptor/docraptor, authenticate with your account API key on the server, submit HTML or a document URL, and save the returned PDF bytes. Use test mode while validating—the test PDF is watermarked. The official integration guide does not establish India-specific pricing, taxes, payment methods, account availability, or data-residency terms, so confirm those separately with DocRaptor before relying on them.
Install the DocRaptor PHP library
Run Composer from your PHP project directory:
composer require docraptor/docraptor
Load Composer’s autoloader in the PHP entry point or service that creates documents:
require_once __DIR__ . "/vendor/autoload.php";
Use the official DocRaptor PHP guide for the current package instructions and client examples.
Create a PDF synchronously from inline HTML
This server-side example creates a watermarked test PDF and writes its binary response to output.pdf. Supply $apiKey from an environment variable or a secrets manager; do not commit the key to source control or expose it in browser code.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitches#1 Best Overall
- RCA Female to HDMI Video Converters Adapter : The cable is used to convert analog composite input to HDMI 1080p output, displayed on a 1080p HD TV/TV/monitor.
- Input ports: 1xRCA Female (Yellow, White, Red), Output ports: 1xHDMI 1.3 1080p. NOT support 3D and 4K, NOT support HDMI Converts to AV
- AV to HDMI Converter: Plug and Play, Easy to Install and Operate, Powered by External USB Cable. Note: Please hook up the USB power cable (included) to 5V 1Apower source during use (not included power supply ).
- Support PAL, NTSC3.58, NTSC4.43, SECAM, PAL/M, PAL/N standard TV formats input. For PS2,PS3,Xbox,N64,STB, VHS, VCR, DVD Players and other devices with standard composite AV input.
- You Will Get : 1x RCA Female TO HDMI Converter, 1xHDMI cable, 1xUSB cable, 1xUser Manual. ONE YEAR WARRANTY - if you are not satisfied for any reason whatsoever, do not hesitate to contact us .
<?php
require_once __DIR__ . "/vendor/autoload.php";
$apiKey = getenv("DOCRAPTOR_API_KEY");
if (!$apiKey) {
throw new RuntimeException("DOCRAPTOR_API_KEY is not configured");
}
$docraptor = new DocRaptorDocApi();
$docraptor->getConfig()->setUsername($apiKey);
$doc = new DocRaptorDoc();
$doc->setTest(true); // Test documents include a watermark.
$doc->setDocumentType("pdf");
$doc->setDocumentContent(
"<!doctype html><html><body><h1>Invoice</h1><p>Example</p></body></html>"
);
try {
$pdf = $docraptor->createDoc($doc);
if (file_put_contents(__DIR__ . "/output.pdf", $pdf) === false) {
throw new RuntimeException("Could not write output.pdf");
}
} catch (DocRaptorApiException $e) {
error_log("DocRaptor request failed: " . $e->getMessage());
throw $e;
}
createDoc() returns PDF data as a binary string for a regular synchronous request, so write it as bytes rather than treating it as JSON or text. The sample catches the client’s ApiException; log diagnostics securely and show users a safe, generic error rather than the API key or sensitive response details.
Choose inline HTML or a document URL
- Inline HTML: set
document_content(or callsetDocumentContent()) when your PHP application has built the markup itself. - Document URL: set
document_urlwhen DocRaptor should render a page at a URL accessible to its service. Ensure that any required assets and authentication are reachable in the rendering context.
For direct REST use, the documented document-creation endpoint is https://api.docraptor.com/docs. Send a JSON payload with type set to pdf and either document_content or document_url. DocRaptor documents HTTP Basic authentication with the API key as the username and a blank password. The official PHP client handles the API request construction for you.
Test, inspect, then use production mode
- Configure an API key on the server and set the document type to
pdf. - Set test mode to
trueand generate representative PDFs. Test output is watermarked; use it to check pagination, fonts, images, links, and layout rather than as a final deliverable. - When the output is ready for real use, set test mode to
falseand use the account’s production API key. Keep the key private and rotate it through your account process if it is exposed.
Test mode is intended for validation; do not mistake a successful, watermarked test render for an unwatermarked production document. DocRaptor’s conversion documentation also cautions against making API calls from public client-side code.
Rendering options: CSS, relative assets, and JavaScript
DocRaptor uses Prince to render HTML to PDF. Most layout behavior belongs in your HTML and CSS. The PHP guide also demonstrates optional PrinceOptions, including a media setting and a base URL for resolving relative resources. Set the base URL deliberately if the document references relative stylesheets, images, or fonts.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteRank #2
- RCA to HDMI Converter: Converts analog RCA composite (Yellow, White, Red) input to HDMI 720P/1080P (60HZ) output,displayed on HDTV/Monitor,which can bring back your childhood memories.
- Plug to Play: ABLEWE Mini RCA to HDMI converter no extra drivers need, just plug and play,easy to use.Please hook up the USB power cable (included) to 5V power source during use.
- Wide Compatibility: Support source formats of PAL, NTSC3.58, NTSC4.43, SECAM, PAL/M, PAL/N standard TV. Provide advanced signal processing with great precision, colors, resolutions, and details.
- Widely Used:Widely applied to PS2,PS3,Xbox,N64, WII, STB, VHS, VCR, DVD Players and other devices with standard composite AV input.
- Attention & Package:Please ensure to connect this rca to hdmi converter to power source to make it work.Package include:1*RCA to HDMI Converter,1*usb power cable(adapter not included),1*User Manual.
JavaScript is off by default
Leave JavaScript disabled unless the page needs client-side rendering. If it does—such as a chart populated by a script—enable the JavaScript option and account for the time needed for scripts or external data to finish. DocRaptor describes delayed-rendering controls because it can be difficult to determine when charts or other dynamic content are complete. See its HTML and JavaScript guide for the documented controls.
Use asynchronous generation for longer documents
DocRaptor’s PHP guide states that synchronous generation has a 60-second maximum and asynchronous generation a 10-minute limit. These are vendor-documented operational limits and may change; confirm the current guidance in the live PHP guide. The guide recommends async generation for large documents or documents with many external assets.
The PHP agent supports createAsyncDoc. Instead of waiting for the PDF bytes in the initial request, submit the job and use status polling or a callback to learn when it is ready; retrieve the result after completion. This fits web applications better when rendering may outlast a normal request-response cycle. Handle pending, completed, and failed jobs explicitly, and do not tell a user that a PDF is ready until retrieval succeeds.
Choose how the resulting PDF is delivered
- Return or store the bytes: A successful ordinary synchronous request returns PDF bytes. Save them, attach them to a response, or pass them to the next part of your application.
- Hosted document: DocRaptor’s API supports hosted documents that return a public URL rather than the document bytes. Review the document hosting details and plan terms before using this delivery model.
- Asynchronous job: The initial response provides a status identifier for later completion and retrieval rather than immediately delivering a finished PDF.
What to confirm when using DocRaptor from India
The published PHP and API pages establish the technical integration, but they do not establish India-specific account eligibility, INR pricing, GST or other tax treatment, local payment methods, data residency, or regulatory suitability. Do not infer those details from a general plan price or the fact that the API can be called from a PHP application.
Rank #3
- Composite to HDMI Converter: Converts analog AV composite (Yellow, White, Red) input to HDMI 720P/1080P (60HZ) output, displayed on smart TV, Projector or HD Display, which bring back your old and cherish memories.
- Plug to Play: This HDMI Converter no extra drivers need, just plug and play,easy to use. Please hook up the USB Power Cable (included) to 5V power source during use. Note: The Video Converters only support converts AV to HDMI, can't converts HDMI to AV.
- Widely Used: This composite to hdmi adapter is widely applied to PS1, PS2, PS3, Xbox, N64, Wii, STB, VHS, VCR, DVD Players and other devices with standard composite AV input. Note: It can only be used when PS2 is set to RGB output.
- Wide Compatibility: This Video Audio Converter Adapter supports source formats of PAL, NTSC3.58, NTSC4.43, SECAM, PAL/M, PAL/N standard TV. Provide advanced signal processing with great precision, colors, resolutions, and details. Important Note: This converter can't improve video quality!
- Attention & Package: Please ensure to connect this av hdmi converter to power source to make it work. Package include: 1*AV to HDMI Adaptor, 1*USB Power Cable(adapter not included), 1*User Manual.
- Ask DocRaptor to confirm whether your intended account and payment arrangement are supported in India.
- Confirm the applicable currency, taxes, invoices, and payment methods for your account.
- Review where document content is processed and whether that meets your organization’s privacy, contractual, or regulatory requirements.
- Check the current plan and hosted-document terms directly before choosing a production delivery path.
Troubleshooting common integration problems
Composer cannot find or install the package
Run composer require docraptor/docraptor from the project root and check that Composer completed successfully. Confirm the PHP process loads the matching project’s vendor/autoload.php.
Authentication fails
Check that the API key is present in the PHP runtime and passed to setUsername(). For direct REST calls, use HTTP Basic authentication with the key as username and an empty password. Never paste the key into public JavaScript.
The PDF has a watermark
The request is in test mode. That is expected for test output. After validating the layout, use the production account key and disable test mode for unwatermarked output.
Images, fonts, or styles are missing
Check that linked resources can be reached by the renderer and that relative paths resolve correctly. Configure a suitable base URL in the Prince options when your HTML uses relative resource paths.
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 →Rank #4
- Convert RCA to HDMI Instantly – BD&M RCA to HDMI Converter easily converts analog RCA/composite AV signals to HDMI output, allowing you to connect older devices to modern HDTVs, monitors, and projectors with clear video and audio quality.
- Wide Device Compatibility – Supports VHS players, VCRs, DVD players, camcorders, retro gaming consoles, and more including PS1, PS2, PS3, Xbox, N64, Wii, and older AV devices with standard RCA output.
- 1080P HDMI Output – Advanced signal processing delivers stable and sharp video output with support for 720P/1080P HDMI resolution, improving compatibility with modern TVs and displays.
- Plug & Play Setup – No drivers or software required. Simply connect the RCA cables, HDMI cable, and included USB power cable for quick and easy installation in minutes.
- Compact & Reliable Design – Lightweight mini converter design makes it perfect for home entertainment setups, retro gaming, travel, or converting old media collections while maintaining stable performance.
Dynamic content is absent or incomplete
JavaScript is disabled by default. Enable it only where needed and use the documented delayed-rendering controls when scripts or external data need time to finish.
A synchronous request takes too long
Large documents and pages with many external assets may exceed the synchronous window. Use the asynchronous flow, then poll or handle the callback and retrieve the completed document.
The application cannot write the PDF
Check that the target path is writable by the PHP process and that the application handles a failed file_put_contents() result. Because the response is binary, avoid transformations that treat it as UTF-8 text.
Or skip the browser setup
If your task is to capture a web page as an image or PDF rather than render a document through DocRaptor, ScreenshotNeo is a separate website screenshot API and MCP server. One GET request can return PNG, JPEG, WebP, or PDF. For example, with its API key configured:
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 →Best Value
- Export or Convert Text, HTML, PNG, JPG, or Camera Pictures to PDFs
- Unlimited use
- No ads
- No personal data taken
- GDPR compliant
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 request options. ScreenshotNeo accepts cookie and consent banners and removes 60+ known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, with response headers indicating the page verdict and billing outcome. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.
Sign up for ScreenshotNeo’s free plan to try 1,000 screenshots a month with no card.
Frequently Asked Questions
Can I use DocRaptor from India?
The official PHP and API documentation explains how to integrate, but does not establish India-specific account availability or commercial terms. Confirm eligibility and billing details with DocRaptor.
Does a successful test request create an unwatermarked PDF?
No. Test-mode output is watermarked; switch to production mode after validating the document.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Does the PHP client return PDF bytes or JSON?
A regular successful synchronous document request returns binary PDF data. Hosted and asynchronous flows have different response behavior.
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.

