---
title: Html to PDF
slug: aura/html-to-pdf
docTags: 
createdAt: 2025-07-07T20:39:55.891Z
---

Utilizado para criar PDF através de HTML.

## Atalhos

- [From string](docId\:GxposN1Z303i53DGvr51h)
- [From URL](docId\:GxposN1Z303i53DGvr51h)

***

### Métodos

### From string

```lua
-- @param html The string containing the HTML.
-- @returns The bytes of the generated PDF
htmltopdf.from_string(html)
```

```lua
-- example usage:

local html = "<html><body><h1>Meu HTML em PDF</h1></body></html>"

local bytes = htmltopdf.from_string(html)
```

### From url

```lua
-- @param url The url to get the HTML
-- @returns The bytes of the generated PDF
htmltopdf.from_url(url)
```

```lua
-- example usage:

local bytes = htmltopdf.from_url("https://www.google.com/")

```

