PDF Export in Postman
Overview
Test and explore the PDFCrowd API directly in Postman. Postman is a popular API development and testing platform. Import our collection to quickly convert HTML to PDF with full access to all API options.
Perfect for: Testing API parameters before integrating into your application, exploring available options, and debugging conversion issues.
Key Features
- URL to PDF: Convert any publicly accessible web page to PDF
- HTML to PDF: Convert raw HTML content to PDF
- Pre-configured requests: Ready-to-use API requests with common options
- Full customization: Control page size, margins, headers, footers, and more
- Environment variables: Store your API credentials securely
How It Works
- Fork or import the PDFCrowd collection in Postman
- Set your PDFCrowd username and API key in environment variables
- Choose a request (URL to PDF or HTML to PDF)
- Configure parameters as needed
- Send the request and download the generated PDF
Quick Start
The following examples demonstrate how to use the PDFCrowd Postman collection to convert HTML to PDF.
Note: You'll need a PDFCrowd account with API access.
For testing, you can use username demo and API key demo.
Sign up to get your own API credentials.
Example 1: Convert a URL to PDF
The simplest use case - convert a web page URL to PDF. This works for any publicly accessible URL.
Request Configuration
| Method: | POST |
| Endpoint: | Export URL to PDF |
| Body (form-data): |
url: https://example.com/invoice/123
|
The response contains the PDF file data. In Postman, click "Save Response" to download the generated PDF.
Example 2: Convert HTML String to PDF
Convert HTML content directly - useful when generating PDFs from templates or dynamic content.
Request Configuration
| Method: | POST |
| Endpoint: | Export HTML String to PDF |
| Body (form-data): |
|
Use Postman's pre-request scripts to dynamically generate HTML content from variables or external data sources.
Example 3: Upload and Convert HTML File
Upload an HTML file for conversion - useful for batch processing or converting existing documents.
Request Configuration
| Method: | POST |
| Endpoint: | Export File to PDF |
| Body (form-data): |
file: Select file (type: File)Choose your HTML file |
Example 4: Check Account Status
Verify your credentials and check your remaining API credits.
Request Configuration
| Method: | GET |
| Endpoint: | Get Account Info |
The response includes your account status and remaining credits.
Authentication
Setting Up Your PDFCrowd Credentials
The PDFCrowd Postman collection uses Basic Authentication with your PDFCrowd API credentials. The collection is pre-configured to use environment variables for easy credential management.
Required Environment Variables
- username
- Your PDFCrowd username - the same username you use to log in to your PDFCrowd account.
- api_key
- Your PDFCrowd API key (not your account password). To get your API key, choose a license plan that includes API access.
Setting Up Environment Variables
- In Postman, click on "Environments" in the left sidebar
- Create a new environment or select an existing one
- Add two variables:
username- set to your PDFCrowd usernameapi_key- set to your PDFCrowd API key
- Select the environment from the dropdown in the top-right corner
API Endpoint
The collection uses https://api.pdfcrowd.com as the base URL
with API version 24.04 for easy configuration across different
environments.
Security Notes
- Store your API key in Postman's "Current Value" field (not synced to cloud) for security.
- You can regenerate your API key anytime from your PDFCrowd account if needed.
- Each API request counts against your account's usage limits.
Error Handling
When a conversion fails, the API returns an HTTP error status code along with a message explaining what went wrong.
Common Errors
401 Unauthorized- Invalid username or API key. Verify your credentials in the Postman environment variables. Make sure you're using your API key, not your account password.
403 Forbidden- Service suspended or insufficient credits. Check your PDFCrowd account for credit balance and account status.
400 Bad Request-
Invalid parameters or missing required fields. Check that you've provided
either a
url,text, orfileparameter. 430 Too Many Concurrent Requests- Too many simultaneous conversions. Your plan has a limit on concurrent requests. Wait for current conversions to complete or upgrade your plan.
For more information on status codes, see our status codes reference.
Debugging Tips
- Check the response body: Error responses include detailed messages explaining the issue.
- Verify authentication: Use the "Get Account Info" endpoint to confirm your credentials are working.
- Test URLs manually: Before converting, test your URL in our API Playground to verify it converts correctly.
- Simplify first: Start with minimal parameters and add options one at a time to identify problematic settings.
Using Postman Tests for Error Handling
You can add tests in Postman to automatically check for errors:
pm.test("Status code is 200", function () {
pm.response.to.have.status(200);
});
pm.test("Response is PDF", function () {
pm.response.to.have.header("Content-Type", "application/pdf");
});
Troubleshooting
Common issues and solutions when using PDFCrowd with Postman.
Connection Issues
- Verify you're using your API key, not your account password
- Check that environment variables are set correctly (username and API key)
- Ensure the environment is selected in Postman before sending requests
Conversion Issues
PDF looks different than expected
- Missing styles: The page may rely on styles that don't load during conversion. Try the Content Viewport Width option to adjust rendering width.
- Dynamic content: JavaScript-generated content may not render. Use the Wait For Element or Javascript Delay options to allow content to load.
- Login required: Pages behind authentication require cookies to be set. Use the Cookies option to pass session cookies.
Images not appearing
- Ensure images use absolute URLs (not relative paths)
- Check that images are publicly accessible
- Some images may be lazy-loaded - use Content Viewport Height set to
large
Conversion is slow
- Large pages with many images take longer to process
- Pages with heavy JavaScript may need time to render
- Consider using simpler HTML templates for faster conversion
Output Issues
Response shows binary data
The API returns binary PDF data by default. In Postman:
- Click "Save Response" to download the PDF file
- Or use the "Send and Download" button instead of "Send"
File name incorrect
Set the output_filename parameter to customize the PDF filename.
Getting Help
- PDFCrowd Support: Contact us for API-related questions
- API Playground: Test conversions in our API Playground to verify settings
- Postman Community: Postman Community Forum for Postman-related questions
Postman Reference
Refer for details to the Postman Reference.