# FileToPDF

> Convert a file URL, HTML or Markdown to PDF and return its base64 content and conversion metadata.

App · 3 actions. Web page: https://docs.lodol.com/docs/integrations/file-to-pdf

## Actions

### Convert file

Convert file.

**Inputs**

- Url (`url`, text, required): Public URL of the file to convert.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "data": {
      "credits_remaining": 1,
      "credits_used": 1,
      "filename": "example",
      "pages": 1,
      "pdf": "example",
      "size_bytes": 1
    },
    "status": "example"
  }
}
```

### Convert html

Convert html.

**Inputs**

- Html (`html`, text, required): The html to convert.
- Css (`css`, text): Additional CSS styles.
- Landscape (`landscape`, true/false): Use landscape pages.
- Print background (`print_background`, true/false): Include background colours and images.
- Paper width (`paper_width`, number): Size in inches. At least 0.
- Paper height (`paper_height`, number): Size in inches. At least 0.
- Margin top (`margin_top`, number): Size in inches. At least 0.
- Margin bottom (`margin_bottom`, number): Size in inches. At least 0.
- Margin left (`margin_left`, number): Size in inches. At least 0.
- Margin right (`margin_right`, number): Size in inches. At least 0.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "data": {
      "credits_remaining": 1,
      "credits_used": 1,
      "filename": "example",
      "pages": 1,
      "pdf": "example",
      "size_bytes": 1
    },
    "status": "example"
  }
}
```

### Convert markdown

Convert markdown.

**Inputs**

- Markdown (`markdown`, text, required): The markdown to convert.
- Css (`css`, text): Additional CSS styles.
- Landscape (`landscape`, true/false): Use landscape pages.
- Print background (`print_background`, true/false): Include background colours and images.
- Paper width (`paper_width`, number): Size in inches. At least 0.
- Paper height (`paper_height`, number): Size in inches. At least 0.
- Margin top (`margin_top`, number): Size in inches. At least 0.
- Margin bottom (`margin_bottom`, number): Size in inches. At least 0.
- Margin left (`margin_left`, number): Size in inches. At least 0.
- Margin right (`margin_right`, number): Size in inches. At least 0.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "data": {
      "credits_remaining": 1,
      "credits_used": 1,
      "filename": "example",
      "pages": 1,
      "pdf": "example",
      "size_bytes": 1
    },
    "status": "example"
  }
}
```
