Skip to main content

Convert URL to PDF using n8n action

PDF4me Convert URL to PDF transforms web pages into high-quality PDF documents through n8n automation workflows. Process web URLs via n8n triggers to capture complete web pages including HTML, CSS, JavaScript, images, fonts, and interactive elements with accurate rendering, responsive layout handling, full-page capture, and professional formatting. This solution is ideal for web page archiving, documentation generation, content preservation, compliance reporting, web scraping, automated snapshots, and digital record-keeping workflows that require reliable URL-to-PDF conversion with accurate web rendering and seamless integration.

Setup

Add the PDF4me "Convert URL to PDF" node to your n8n workflow and configure the required parameters. For initial setup instructions, see our n8n Integration Guide.

Prerequisites:

  • PDF4me API credentials
  • n8n workflow access

Configuration:

  1. Add PDF4me node to workflow
  2. Select "Convert URL to PDF" action
  3. Configure input parameters (see below)
Convert URL To PDF

Parameters

Complete list of parameters for the Convert URL to PDF action. Configure these parameters to control URL to PDF conversion.

Important: Parameters marked with an asterisk (***) are required and must be provided for the action to function correctly.

ParameterTypeDescriptionExample
Web URL***StringTarget Webpage URL
• The complete web address of the page to be converted to PDF
• PDF4me's advanced rendering engine processes the webpage
• Must be a valid, accessible URL
https://example.com/page
File Name***StringPDF Output Filename
• Specify the name for the generated PDF file
• Must include .pdf extension
• PDF4me ensures unique naming and format validation
URL_TO_PDF.pdf
Authentication Type***StringWebsite Authentication Method
• Specify the authentication type for protected websites
• Options: No Authentication, Basic Authentication, OAuth, API keys
• PDF4me supports various authentication methods
No Authentication
Page Layout***StringPage Orientation Setting
• Choose between Portrait (vertical) or Landscape (horizontal)
• Affects PDF page dimensions and content flow
• Default is Portrait
Portrait
Page Format***StringPage Size Format
• Select the paper size format for PDF generation
• Supports standard formats: A-series, Legal, Tabloid
• Default is A4
A4
Binary Data Output Name***StringBinary Data Output Mapping
• Define the variable name for accessing generated PDF binary data
• Used in subsequent workflow actions
• Essential for workflow automation
data

Advanced Options

The following parameters are available in the Advanced Options section and are optional:

ParameterTypeDescriptionExample
ScaleDecimalContent Scaling Factor
• Control the size of content in the PDF
• 1.0 represents 100% original size
• Maintains quality while adjusting dimensions
0.8
Top MarginStringTop Margin Configuration
• Set the top margin space (pixels, inches, or centimeters)
• Ensures consistent spacing from top edge
• Default is 40px
40px
Left MarginStringLeft Margin Configuration
• Define the left margin space for content positioning
• Maintains consistent left alignment
• Default is 40px
40px
Right MarginStringRight Margin Configuration
• Set the right margin to control content width
• Prevents text cutoff
• Default is 40px
40px
Bottom MarginStringBottom Margin Configuration
• Configure bottom spacing for proper page layout
• Prevents content from being cut off
• Default is 40px
40px
Print BackgroundBooleanBackground Printing Control
• Enable or disable background elements (colors, patterns, images)
• Ensures accurate visual representation
• Default is true
true
Display Header FooterBooleanHeader/Footer Visibility
• Control inclusion of page headers and footers
• Includes page numbers, titles, timestamps
• Default is true
true
Custom ProfilesStringCustom Configuration Profiles
• Set additional options using custom profiles
• JSON-like format containing predefined parameters
• Enables advanced PDF generation settings
• Optional for specialized requirements
{ "outputDataFormat": "base64" }

Output

Output Parameters

ParameterTypeDescriptionExample
fileNameStringPDF4me generated PDF filename - The complete filename of the successfully generated PDF document with proper .pdf extension. PDF4me ensures unique naming and validates file format compliance for seamless integration with downstream processesURL_TO_PDF.pdf
mimeTypeStringPDF4me MIME type identifier - The standardized MIME type for the generated PDF file, always set to application/pdf by PDF4me's conversion engine. This ensures proper file handling and recognition across all systems and applicationsapplication/pdf
fileSizeNumberPDF4me PDF file size in bytes - The exact size of the generated PDF file in bytes, provided by PDF4me for storage planning, bandwidth optimization, and file transfer monitoring. Essential for enterprise document management and workflow automation1347439
successBooleanPDF4me conversion status indicator - Boolean flag indicating the success or failure of the URL-to-PDF conversion process. PDF4me returns true for successful conversions and false for any errors, enabling robust error handling in automated workflowstrue
sourceUrlStringPDF4me source URL reference - The original webpage URL that was processed by PDF4me's conversion engine. This reference is maintained for audit trails, debugging purposes, and tracking the source of generated PDF documents in enterprise workflowshttps://en.wikipedia.org/wiki/Main_Page
layoutStringPDF4me page orientation setting - The page orientation used during PDF generation by PDF4me's rendering engine. Indicates whether the PDF was created in Portrait (vertical) or Landscape (horizontal) orientation as specified in the input parametersportrait
formatStringPDF4me page size format - The paper size format used for PDF generation by PDF4me's document processing engine. Reflects the page dimensions (A4, A3, Letter, etc.) that were applied during the conversion process for consistent document formattingA4

###N8N Action Response

The PDF4me Convert URL to PDF 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:

[
{
"fileName": "URL_TO_PDF.pdf",
"mimeType": "application/pdf",
"fileSize": 1347439,
"success": true,
"sourceUrl": "https://en.wikipedia.org/wiki/Main_Page",
"layout": "portrait",
"format": "A4"
}
]

Use Cases

  • Convert web pages, online articles, and digital content to PDF format for legal evidence, compliance documentation, and regulatory record keeping
  • Process dynamic web content, social media posts, and online communications by converting them to PDF format for legal discovery, litigation support, and evidence preservation
  • Archive website snapshots, online documentation, and digital assets to PDF format for historical preservation, compliance auditing, and regulatory reporting

Business Intelligence and Competitive Analysis

  • Convert competitor websites, market research pages, and industry reports to PDF format for competitive analysis, market intelligence, and strategic planning
  • Process online dashboards, analytics reports, and business metrics by converting them to PDF format for executive reporting, board presentations, and stakeholder communications
  • Transform web-based surveys, customer feedback, and online reviews to PDF format for analysis, reporting, and business decision-making

Content Management and Digital Publishing

  • Convert web-based content, online articles, and digital publications to PDF format for print distribution, offline access, and content archiving
  • Process online forms, web applications, and digital workflows by converting them to PDF format for record keeping, compliance documentation, and process documentation
  • Transform web-based catalogs, product pages, and marketing content to PDF format for offline distribution, print marketing, and customer communications

Get Help