Convert URL to PDF - Web Page Saver API
PDF4me Convert URL to PDF is a powerful enterprise-grade solution that transforms web pages and HTML content into high-quality PDF documents through advanced API integration. This comprehensive URL to PDF conversion service efficiently processes web URLs, extracting content, images, and styling while preserving layout and formatting for professional PDF document creation. The API processes URL to PDF conversion by receiving web page URLs through REST API calls, utilizing advanced rendering technology and intelligent content extraction algorithms for accurate web page rendering and PDF generation. With comprehensive support for web content extraction, layout preservation, authentication handling, and customization options, this solution is ideal for web content management, document archiving, report generation, and enterprise web-to-PDF workflows that require reliable, scalable URL to PDF conversion with guaranteed content accuracy and professional output quality. Convert any web page to PDF using its URL. Easily automate this conversion with the URL to PDF PDF4me connector in API.
Authenticating Your API Request
To access the PDF4me REST API, every request must include proper authentication credentials. Authentication ensures secure communication and validates your identity as an authorized user of the REST API.
Key Features
- Web Page Processing: Convert any web page or URL into high-quality PDF documents
- HTML Content Support: Process HTML code, CSS styles, and JavaScript elements with embedded content
- Dynamic Content Handling: Convert both static HTML templates and dynamic web pages with real-time content
- Layout Preservation: Maintain original web page layout, styles, and structure in PDF format
- Authentication Support: Handle protected websites with various authentication methods
- Customization Options: Control page size, margins, headers, footers, and output formatting
- Seamless API Integration: RESTful API designed for automated web-to-PDF workflows and enterprise system integration
REST API Endpoint
The PDF4me REST API uses standard HTTP methods to interact with resources. All URL to PDF conversion operations are performed through a single endpoint:
- Method: POST
- Endpoint:
/api/v2/ConvertUrlToPdf
Supported Web Content Types
The API provides comprehensive support for various web content types and conversion scenarios:
Web Page Types
- Static HTML Pages: Standard web pages with HTML, CSS, and basic JavaScript
- Dynamic Web Applications: Single-page applications (SPAs) and dynamic content
- Responsive Websites: Mobile and desktop optimized web pages
- Protected Content: Password-protected or authenticated web pages
- Interactive Elements: Pages with forms, buttons, and interactive components
Content Processing Capabilities
- HTML Rendering: Full HTML5 support with modern web standards
- CSS Styling: Complete CSS2/CSS3 support including flexbox and grid layouts
- JavaScript Execution: Client-side JavaScript rendering and dynamic content
- Image Handling: Automatic image loading, optimization, and embedding
- Font Support: Web fonts and custom typography preservation
Authentication Methods
- No Authentication: Public websites without login requirements
- Basic Authentication: Username/password protected content
- OAuth Integration: Token-based authentication for modern web applications
- API Key Authentication: Key-based access for protected APIs and content
REST API Parameters
Complete list of parameters for the Convert URL to PDF REST API. Parameters are organized by category for better understanding and implementation.
Important: Parameters marked with an asterisk (*) are required and must be provided for the API to function correctly.
Required Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
| Web URL* | String | Web URL of the page that needs to be converted as PDF. | https://www.google.com |
| Auth Type* | String | Specify the authentication type required to access the website URL, if applicable. Some websites may require authentication methods such as Basic Authentication, OAuth, or API keys before allowing access. If no authentication is needed, this field can be left blank. | NoAuth |
| Username* | String | Enter the username if authentication is required to access the website or resource. This is typically used along with a password or token, depending on the authentication method. | userName |
| Password* | String | Enter the password if authentication is required to access the website or resource. This is typically used along with a username, depending on the authentication method. | 1234 |
| File content* | Base64 | Map the base file content for URL to PDF conversion processing | JVBERi... |
| File Name* | String | Output PDF file name with extension for the converted URL content | output.pdf |
| Layout* | String | - Landscape – The page will be oriented horizontally, wider than it is tall. - Portrait – The page will be oriented vertically, taller than it is wide. | landscape or portrait |
| Format* | String | You can select any one format - A0, A1, A2, A3, A4, A5, A6, A7, A8 - Tabloid - Legal - Statement - Executive | A4 |
| Scale* | Decimal | Specify the scale for the URL-to-PDF conversion. The value must be provided in decimal format, where 1.0 represents 100% (original size). Smaller values reduce the content size, while larger values (up to the supported limit) enlarge it. | 0.8 |
| Top Margin* | String | Specify the top margin of the PDF file. The value must be provided in string format along with a valid unit (e.g., px, in, cm). This margin defines the space between the top edge of the page and the content. | 40px |
| Left Margin* | String | Specify the left margin of the PDF file. The value must be provided in string format along with a valid unit (e.g., px, in, cm). This margin defines the space between the left edge of the page and the content. | 40px |
| Right Margin* | String | Specify the right margin of the PDF file. The value must be provided in string format along with a valid unit (e.g., px, in, cm). This margin defines the space between the right edge of the page and the content. | 40px |
| Bottom Margin* | String | Specify the bottom margin of the PDF file. The value must be provided in string format along with a valid unit (e.g., px, in, cm). This margin defines the space between the bottom edge of the page and the content. | 40px |
| Print Background* | Boolean | - Selecting true will print the background elements (such as colors, patterns, or images) along with the page content. - Selecting false will exclude the background, and only the main text and elements will be included in the PDF. | true or false |
| Display Header Footer* | Boolean | - Selecting true will include headers and footers (such as page numbers, titles, or other predefined information) in the PDF. - Selecting false will exclude headers and footers, showing only the main content. | true or false |
Output
The PDF4me Convert URL to PDF REST API returns a response that can be viewed in multiple formats. Choose the view that best fits your needs:
- JSON
- Table
- Schema
- Binary
JSON Response Format
The raw JSON response from the API:
{
"File Content": "Output file content from PDF4me action",
"File Name": "Output file name from PDF4me action"
}
Table View
Response data in a structured table format:
| Parameter | Value |
|---|---|
| File Content | Output file content from PDF4me action |
| File Name | Output file name from PDF4me action |
Schema View
The data structure and types of the response:
2 items
File Content: Base64 Output file content from PDF4me action
File Name: String Output file name from PDF4me action
Type Indicators:
Base64= Binary dataString= Text data
Binary Data View
The actual converted PDF file data and metadata:
data
─────────────────────────────
File Content: Output file content from PDF4me action
File Name: Output file name from PDF4me action
Binary Data Access:
- PDF Content: Ready for download or further processing
- URL Conversion: Complete web page to PDF transformation
Request Example
Header
Content-Type: application/json
Authorization: YOUR_API_KEY
Note: Get your API key from the PDF4me Dashboard
Payload
{
"webUrl": "https://www.google.com",
"authType": "NoAuth",
"username": "userName",
"password": "1234",
"docContent": "Please put PDF base64 content",
"docName": "output.pdf",
"layout": "landscape",
"format": "A4",
"scale": 0.8,
"topMargin": "40px",
"leftMargin": "40px",
"rightMargin": "40px",
"bottomMargin": "40px",
"printBackground": true,
"displayHeaderFooter": true
}
Code Samples
The PDF4me Convert URL to PDF REST API provides code samples in multiple programming languages. Choose the language that best fits your development environment:
- C#
- Java
- JavaScript
- Python
- Salesforce
- n8n
- Google Script
- AWS Lambda
Google Script Sample
Google Apps Script implementation for Google Workspace integration:
URL to PDF Conversion Features
Web Content Processing
- HTML Rendering: Full HTML5 support with modern web standards and responsive design
- CSS Styling: Complete CSS2/CSS3 support including flexbox, grid layouts, and animations
- JavaScript Execution: Client-side JavaScript rendering for dynamic content and interactions
- Image Handling: Automatic image loading, optimization, and proper scaling in PDF format
Layout and Formatting
- Page Orientation: Support for both landscape and portrait page orientations
- Page Sizes: Multiple standard page formats (A0-A8, Tabloid, Legal, Statement, Executive)
- Margins: Customizable top, bottom, left, and right margins with various units
- Scaling: Decimal-based scaling for content size adjustment (0.1 to 2.0 range)
Advanced Features
- Background Printing: Option to include or exclude background colors, patterns, and images
- Header/Footer Display: Configurable headers and footers with page numbers and titles
- Authentication Support: Handle protected websites with various authentication methods
- Interactive Elements: Preserve links, buttons, and form elements in PDF format
Industry Use Cases & Applications
- Business & Enterprise
- Legal & Professional Services
- Marketing & Sales
- Government & Compliance
Business & Enterprise Use Cases
- Report Generation: Automatically generate PDF reports from dynamic web-based dashboards
- Document Management: Transform web content into PDF format for enterprise document systems
- Web Content Archiving: Convert web pages to PDF for long-term storage and compliance
- Business Dashboards: Convert business dashboards to PDF for reporting
Legal & Professional Services Use Cases
- Legal Documentation: Create PDF versions of web pages for legal evidence and compliance
- Evidence Collection: Convert web pages to PDF for legal evidence
- Compliance Documentation: Transform web content to PDF for compliance
- Legal Archiving: Convert legal web content to PDF for archival
Marketing & Sales Use Cases
- Email Attachments: Convert HTML email templates and web content to PDF for sharing
- Marketing Materials: Transform web marketing content to PDF
- Sales Reports: Convert sales dashboards to PDF for reporting
- Client Communications: Transform web content to PDF for client communications
Government & Compliance Use Cases
- Web Content Archiving: Convert web pages to PDF for long-term storage and compliance
- Public Records: Transform public web content to PDF for archival
- Regulatory Documentation: Convert regulatory web content to PDF
- Government Archives: Transform government web content to PDF for archival