# HTML para PDF

<figure><img src="/files/Kq1O5wHYQTcMX8fyiSiS" alt=""><figcaption></figcaption></figure>

Através desse conector conseguimos transformar um arquivo HTML em PDF, configurando os campos a seguir:

<figure><img src="/files/UUnvzdlrxGLNDQQWTWmy" alt=""><figcaption></figcaption></figure>

**Autorização:** Caso necessário, selecione uma autorização para obter o arquivo desejado.

**Nome do arquivo PDF:** Defina o nome do arquivo pdf de saida conforme exemplo na imagem.

**Arquivo HTML:** Caminho para o arquivo HTML que será convertido. Na imagem de exemplo estamos obtendo o arquivo de um step anterior.

O 'OUTPUT' que é gerado na tela de execuções neste conector possui o caminho para o arquivo PDF e seu tamanho em KB.

**Dica:**

Para definir a orientação das paginas do seu arquivo PDF como 'Paisagem', você deve adicionar uma configuração no estilo (CSS) do seu HTML, exemplo:

```html
<style>        
    @page { size: landscape; }
</style>
```

**Exemplo:**

```html
<html>
<head>
    <style>
        @page {
            size: A4 landscape;
            margin: 20mm;
        }
        body {
            font-family: Arial, sans-serif;
        }
    </style>
</head>
<body>
    <h1>Teste PDF</h1>
</body>
</html>
```

<figure><img src="/files/p4vAdHZPxjH5pAaM2ksN" alt=""><figcaption><p>Resultado do exemplo</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.apipass.com.br/documentacao-apipass/desenvolvimento-de-fluxos/componentes-do-fluxo/conectores-steps/pdf/html-para-pdf.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
