FileToPDF.dev ACTION
Convert a File to PDF
Convert Word, Excel, PowerPoint, images and 130+ formats into PDF — from a file or a public URL. The converter is chosen automatically from the file extension. See the documentation.
- Action
- Writes data
- API key
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's FileToPDF.dev account once, then configure and run Convert a File to PDF from your backend or agent.
import { PipedreamClient } from "@pipedream/sdk"
const pd = new PipedreamClient({
projectId: process.env.PIPEDREAM_PROJECT_ID!,
clientId: process.env.PIPEDREAM_CLIENT_ID!,
clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
projectEnvironment: "production",
})
const result = await pd.actions.run({
id: "filetopdf_dev-convert-file",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
filetopdf_dev: { authProvisionId: "apn_xxxxxxx" },
file: "File",
url: "File URL",
},
})
console.log(result)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "filetopdf_dev-convert-file",
"configured_props": {
"filetopdf_dev": { "authProvisionId": "apn_xxxxxxx" },
"file": "File",
"url": "File URL"
}
}'// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "filetopdf_dev",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
name: "filetopdf_dev-convert-file",
arguments: {
file: "File",
url: "File URL",
},
})SCHEMA
Inputs
Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.
| Property | Type | Description |
|---|---|---|
file File | string | The file to convert — a path to a file in /tmp (map it from a previous step, e.g. Google Drive, Dropbox, an HTTP download, an email attachment) or a downloadable URL. We read it and upload it. Leave blank if you're using a File URL instead. Optional |
url File URL | string | Or a public http(s) link to your file — FileToPDF downloads it server-side and converts by its extension. (Private/internal addresses aren't allowed.) Used only when no File is provided. Optional |
filename File Name | string | Your file's name, including its extension — e.g. report.docx. We use the extension to pick the converter and to name your PDF. Usually detected automatically; set it here if your file has no extension or the wrong one. Optional |
landscape Landscape Orientation | boolean | Render the page in landscape orientation. Optional |
nativePageRanges Page Ranges | string | Limit output to specific pages, e.g. 1-3 or 2,5-7. Optional |
pdfa PDF/A Archival Format | string | Produce an ISO-standardised archival PDF. Optional |
pdfua PDF/UA (Accessibility) | boolean | Produce an accessible, tagged PDF/UA document. Optional |
sourcePassword Source Document Password | string | Password to open a protected source document (office files only). Optional |
userPassword Output Open Password | string | Encrypt the resulting PDF; this password is required to open it. Optional |
ownerPassword Output Permissions Password | string | Restrict editing/printing of the resulting PDF. Optional |
syncDir SyncDir | dir | Required |
REFERENCE
Tool details
Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.
- Registry key
- filetopdf_dev-convert-file
- Version
- 0.0.2
- App
- FileToPDF.dev
- Authentication
- API key
- Read-only
- No
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗