Skip to main content

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

ParameterTypeDescriptionExample
Web URL*StringWeb URL of the page that needs to be converted as PDF.https://www.google.com
Auth Type*StringSpecify 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*StringEnter 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*StringEnter 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*Base64Map the base file content for URL to PDF conversion processingJVBERi...
File Name*StringOutput PDF file name with extension for the converted URL contentoutput.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*StringYou can select any one format - A0, A1, A2, A3, A4, A5, A6, A7, A8 - Tabloid - Legal - Statement - ExecutiveA4
Scale*DecimalSpecify 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*StringSpecify 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*StringSpecify 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*StringSpecify 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*StringSpecify 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 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"
}

Request Example

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# (CSharp) Sample

Complete C# implementation for URL to PDF conversion:

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 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

Get Help