If PDFShift returns 422 invalid HTML, capture the complete response body and check both the request and the source you sent. PDFShift’s published examples document a v3 conversion request with a source value containing either raw HTML or a URL, but they do not define this exact error message or establish one definitive cause. Diagnose from the response payload rather than assuming the markup is malformed.
1. Capture the full error before changing the request
Record the HTTP status and response body for the failed request. A status-only log discards information that may distinguish a request-validation problem from a source-loading failure. PDFShift’s Python examples check unsuccessful responses and expose the response text or content; its aiohttp guide likewise recommends handling error details and notes that an error response does not contain a PDF. See PDFShift’s Python guide and aiohttp guide.
Do not log an API key or sensitive document content. If the body itself may contain private data, redact it before sharing or retaining it. Preserve enough sanitized detail to compare failing and successful requests.
2. Verify the documented request envelope
PDFShift’s v3 conversion endpoint is https://api.pdfshift.io/v3/convert/pdf. Its examples use a POST request with a JSON body containing source; that value can be raw HTML or a URL. Check that your client is sending the intended endpoint, method, JSON body, and source field, and that its API-key configuration is correct for the client or workflow. These checks validate the documented request shape; they do not establish that any particular mismatch causes this exact 422. See PDFShift’s API guides and PDFShift.
#1 Best Overall
- 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.
3. Identify which source path you are using
Raw HTML source
Confirm that the application passes the complete generated HTML as a JSON string—not as a separately concatenated or incorrectly escaped fragment. Use a JSON encoder rather than manually escaping quotation marks, backslashes, or newlines. Inspect the final serialized request body with secrets and sensitive content removed. A minimal HTML document can help determine whether the problem appears only after your template or assets are added.
URL source
Check whether the page is reachable by the conversion service, not merely by your own browser. Look for login requirements, private routes, access controls, redirects, or other conditions that prevent an external service from retrieving it. PDFShift documents a raise_for_status option for treating an unsuccessful remote-source response as a conversion failure; consult its Python guide for the relevant client example.
Rank #2
- 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.
Raw HTML and URL input are distinct diagnostic paths. For raw HTML, inspect the generated markup and JSON encoding. For a URL, investigate remote retrieval and page access. Do not assume that using a particular programming language is itself the cause.
4. Reduce external dependencies and isolate the failing part
PDFShift recommends avoiding unnecessary network requests during conversion. Its help guidance suggests sending raw HTML, inlining CSS and JavaScript where practical, removing unnecessary scripts, considering base64 image data, and optimizing image sizes. These measures reduce external dependencies and can simplify diagnosis; PDFShift does not document them as guaranteed fixes for this exact 422. Read PDFShift Help Center’s conversion-time advice, which says, “Generally speaking, avoid any network requests.”
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Rank #3
- 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
- Try a small valid HTML document using the documented raw-HTML input mode.
- Add your application-generated template and compare the complete sanitized response.
- Reintroduce scripts, stylesheets, fonts, and images in stages, checking the result after each change.
- If using a URL source, test a page that is publicly reachable and remove access restrictions only where appropriate for your security requirements.
This staged test is a diagnostic technique, not a published PDFShift remedy for the exact message. Keep the request and response details for each case so you can identify what changed.
5. Common symptoms and what to check
| What you observe | What to inspect | Next step |
|---|---|---|
| The log shows only “422” | The response body was discarded or never logged. | Capture the full response content safely before retrying. |
| The source is raw HTML | The final HTML string, JSON encoding, and the presence of the expected source field. |
Try a minimal document, then add generated content and assets incrementally. |
| The source is a URL | Reachability from the conversion service, authentication, route access, and redirects. | Test an accessible URL or use raw HTML to separate retrieval from markup concerns. |
| The response remains ambiguous | The sanitized response body and a minimal reproducible request. | Send those details to PDFShift support and ask what condition triggers the exact message. |
Or skip the browser setup
If your goal is to capture a website as an image or PDF rather than debug a PDFShift conversion, ScreenshotNeo provides a website screenshot API and MCP server. One GET request can return an image or PDF; the example below captures a page as WebP. See the ScreenshotNeo documentation for request options.
Rank #4
- 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.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and each response reports the page verdict and billing status in headers. An MCP server exposes screenshot tools to Claude, Cursor, and other MCP clients. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up free for 1,000 screenshots a month, with no card required.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Frequently Asked Questions
Does HTTP 422 prove that my HTML is malformed?
No. The available PDFShift documentation does not define this exact error phrase or confirm a single cause. Use the response body and request details, and ask PDFShift support if those do not identify the condition.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsShould I test raw HTML or a URL first?
Test the input mode your integration actually uses. If you need to separate remote-page retrieval from HTML handling, compare with a minimal raw-HTML request.
Quick Recap
Best Value
- Full-featured PDF Editor: Edit text in the document
- Fully convert PDF to Word and Excel and continue editing
- NEW: Further development of existing functions
- NEW: Even faster and more user-friendly
- NEW: Over 75 small improvements in all areas
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.




