Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →To convert HTML to PDF with DocRaptor, send an authenticated JSON POST request to https://api.docraptor.com/docs with type set to pdf and either document_content or document_url. For a successful synchronous request, save the binary response as a PDF; check the HTTP status first so an error response is not mistaken for a document.
Choose HTML content or a document URL
Use document_content when your application already has the HTML string. Use document_url when the document is available at a URL DocRaptor can retrieve. A PDF request needs type: "pdf" and one of these inputs.
As an Amazon Associate I earn from qualifying purchases.
| Input | Use it when | What to check |
|---|---|---|
document_content |
Your application has the HTML or XML content. | If the supplied markup uses relative asset URLs, set a base URL, for example with prince_options.baseurl. |
document_url |
The document is served from a retrievable URL. | DocRaptor must be able to fetch the page and any assets it needs. |
DocRaptor’s [conversion guide] shows the prince_options.baseurl approach for content with relative links. Validate asset loading with your actual document and consult the current API reference for supported request fields.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, 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 minuteSend a PDF request from your server
The following Python example posts HTML directly, authenticates with HTTP Basic Authentication using the API key as the username and a blank password, checks for an HTTP error, and writes the returned bytes to invoice.pdf. Keep the real key in a server-side secret or environment variable; do not put it in client-side code.
#1 Best Overall
- EDIT text, images & designs in PDF documents. ORGANIZE PDFs. Convert PDFs to Word, Excel & ePub.
- READ and Comment PDFs – Intuitive reading modes & document commenting and mark up.
- CREATE, COMBINE, SCAN and COMPRESS PDFs
- FILL forms & Digitally Sign PDFs. PROTECT and Encrypt PDFs
- LIFETIME License for 1 Windows PC or Laptop. 5GB MobiDrive Cloud Storage Included.
import os
import requests
api_key = os.environ["DOCRAPTOR_API_KEY"]
html = "<html><body><h1>Invoice</h1></body></html>"
response = requests.post(
"https://api.docraptor.com/docs",
auth=(api_key, ""),
json={"type": "pdf", "document_content": html},
timeout=120,
)
response.raise_for_status()
with open("invoice.pdf", "wb") as pdf_file:
pdf_file.write(response.content)
print("Saved invoice.pdf")
Install the dependency with python -m pip install requests. For URL input, replace the document_content member with "document_url": "https://example.com/invoice". The endpoint, authentication method, and binary response behavior are described in DocRaptor’s API overview.
Equivalent cURL request
curl --user "$DOCRAPTOR_API_KEY:"
--header "Content-Type: application/json"
--data '{"type":"pdf","document_content":"<html><body><h1>Invoice</h1></body></html>"}'
"https://api.docraptor.com/docs"
--output invoice.pdf
In cURL’s Basic Authentication syntax, the colon after the key supplies the blank password. The example writes the response body to a file, so check the HTTP status as well when adapting it for production; otherwise an error body could be saved with a .pdf extension.
Rank #2
- Edit PDFs with Ease. Modify text, images, and layouts directly within your PDF documents.
- Convert & Organize. Export PDFs to Word, Excel, or ePub, and organize files with ease.
- Read & Annotate. Enjoy intuitive reading modes and powerful tools to comment, highlight, and mark up PDFs.
- Create & Manage PDFs. Create new PDFs, combine multiple files, scan documents, and compress for easy sharing.
- Fill & Sign Forms. Complete forms and digitally sign documents with secure e-signature tools.
Enable JavaScript only when the document needs it
JavaScript execution is disabled by default. Leave it off for static documents; enable the documented JavaScript option when the PDF depends on content generated by scripts, such as a chart. DocRaptor’s JavaScript execution guide describes two engines and recommends its primary engine for most users. Enabling both evaluates the page’s JavaScript twice, so choose the engine your document requires rather than turning on both by default.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesIf JavaScript fills in content asynchronously, conversion must wait until rendering is complete. DocRaptor documents a docraptorJavaScriptFinished() function that signals completion. JavaScript errors can also cause document creation to fail. See its HTML and JavaScript tutorial for the current configuration and completion behavior.
Rank #3
- Create and edit PDFs. Collaborate with ease. E-sign documents and collect signatures. Get everything done in one app, wherever you go.
- Edit text and images without jumping to another app.
- E-sign documents or request e-signatures on any device. Recipients don’t need to log in to e-sign.
- Convert PDFs to editable Microsoft Word, Excel, or PowerPoint documents.
- Share PDFs for collaboration. Commenting features make it easy for reviewers to comment, mark up, and annotate.
Set print styling and page layout
Use CSS to define the layout you want on paper. DocRaptor’s examples include prince_options.media to choose between screen and print styles. If your site has print-specific rules, select print media; if it relies on screen styles, select screen media. Do not assume every browser-specific CSS behavior will render identically in PDF: inspect representative output and consult DocRaptor’s current style and formatting documentation.
Handle the response correctly
For a successful synchronous request, the response body is the PDF’s binary data. Save it as bytes, as in the examples above, or pass those bytes through your server to a browser download. DocRaptor documents other workflows with different response handling: hosted generation returns a public URL, and asynchronous generation returns a status identifier that you use to retrieve the completed document. Choose those modes when your application needs hosted delivery or a separate generation-and-retrieval flow.
Rank #4
- Perfect Adobe Acrobat Pro alternative – lifetime license for Windows 10 and 11.
- EDIT text, images, pages, hyperlinks, designs in PDF documents. ORGANIZE PDFs.
- READ and Comment on PDFs – Intuitive reading modes & document commenting and mark up tools!
- CREATE, COMBINE, SCAN and COMPRESS PDFs.
- FILL forms & Digitally Sign PDFs. Work with Digital certificates
Check the HTTP status before treating the body as a PDF. DocRaptor says generation errors return XML, and its API overview explains that status codes indicate success or failure. For PDF responses, the X-DocRaptor-Num-Pages header reports the page count. See the API overview for response details.
Keep the API key out of public browser code
A browser-side integration can expose its API key to anyone who can inspect the page. DocRaptor’s tutorial warns that its hidden-form browser approach still exposes the key in page source and is not suitable for publicly accessible use. Prefer a server-side endpoint that authenticates with the key and returns the generated PDF to your application. DocRaptor also describes a referrer-based workflow; assess that option against your access-control needs before using it. See the official tutorial.
Best Value
- ALL-IN-ONE SOLUTION – read, edit, convert, merge and protect your PDF files
- MAXIMUM FUNCIONALITY – create interactive forms, compare PDFs, bates numbering, find and replace text or colors, convert documents, OCR engine, comment, highlight, fill out and print forms, document protection and others
- EASY TO INSTALL AND USE – well-structured user-interface, in-program instructions, free tech support whenever you need it
- GREAT VALUE FOR MONEY - why spend a fortune if you can have maximum functionality at a reasonable price - this also fits the requirements of companies very well
Troubleshoot common conversion failures
- The saved file is not a PDF: Check the HTTP status and response before saving or serving the body. Error responses can contain XML rather than PDF data.
- The request is rejected or lacks a document: Confirm the JSON includes
"type": "pdf"and exactly one usable input,document_contentordocument_url. - Images, stylesheets, or fonts are missing: For content supplied as a string, configure an appropriate base URL for relative links. For URL input, ensure DocRaptor can retrieve the page and its required assets.
- Script-generated content is absent: JavaScript is off by default. Enable the required engine and ensure delayed rendering signals completion with the documented mechanism.
- Document generation fails after enabling scripts: Check for JavaScript errors and whether the selected engine matches the page’s needs; using both engines runs the page’s JavaScript twice.
- The API key appears in page source: Move authenticated generation to a server-side request path or evaluate DocRaptor’s referrer-based approach instead of exposing a production key in public code.
Or skip the browser setup
If your task is to capture a web page as an image or PDF rather than generate a formatted document through DocRaptor, ScreenshotNeo is a website screenshot API and MCP server for developers. Its one-call API captures a URL; for a WebP screenshot:
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 more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each of those steps can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and whether the request was billed. Its MCP server lets AI agents use take_screenshot, get_page_info, and capture_pdf. The free plan includes 1,000 screenshots a month without a card; paid plans start at $5 for 3,000 shots. Sign up free for ScreenshotNeo.
Frequently Asked Questions
Can DocRaptor return a PDF from an HTML string instead of a URL?
Yes. Set document_content to the HTML string and set type to pdf.
How can I tell how many pages the generated PDF contains?
For PDF responses, DocRaptor documents the X-DocRaptor-Num-Pages response header.
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.




