# `PDFShift.Types`
[🔗](https://github.com/sgerrand/ex_pdf_shift/blob/v0.2.1/lib/pdf_shift/types.ex#L1)

Type definitions for the PDFShift API.

# `auth`

```elixir
@type auth() :: %{username: String.t(), password: String.t()}
```

Authentication settings for password-protected content.

# `convert_options`

```elixir
@type convert_options() :: %{
  optional(:sandbox) =&gt; boolean(),
  optional(:encode) =&gt; boolean(),
  optional(:filename) =&gt; String.t(),
  optional(:webhook) =&gt; String.t(),
  optional(:s3_destination) =&gt; String.t(),
  optional(:timeout) =&gt; integer(),
  optional(:wait_for) =&gt; String.t(),
  optional(:landscape) =&gt; boolean(),
  optional(:lazy_load_images) =&gt; boolean(),
  optional(:css) =&gt; String.t(),
  optional(:javascript) =&gt; String.t(),
  optional(:disable_javascript) =&gt; boolean(),
  optional(:disable_backgrounds) =&gt; boolean(),
  optional(:remove_blank) =&gt; boolean(),
  optional(:delay) =&gt; integer(),
  optional(:raise_for_status) =&gt; boolean(),
  optional(:use_print) =&gt; boolean(),
  optional(:format) =&gt; String.t(),
  optional(:pages) =&gt; String.t(),
  optional(:zoom) =&gt; number(),
  optional(:is_gdpr) =&gt; boolean(),
  optional(:is_hipaa) =&gt; boolean(),
  optional(:margin) =&gt; margin(),
  optional(:auth) =&gt; auth(),
  optional(:cookies) =&gt; [cookie()],
  optional(:http_headers) =&gt; http_headers(),
  optional(:header) =&gt; header(),
  optional(:footer) =&gt; footer(),
  optional(:protection) =&gt; protection(),
  optional(:watermark) =&gt; watermark()
}
```

Request options for converting HTML/URL to PDF.

# `cookie`

```elixir
@type cookie() :: %{
  :name =&gt; String.t(),
  :value =&gt; String.t(),
  optional(:secure) =&gt; boolean(),
  optional(:http_only) =&gt; boolean()
}
```

Cookie settings for requests when loading the source.

# `credits_response`

```elixir
@type credits_response() :: %{
  credits: %{
    base: integer(),
    remaining: integer(),
    total: integer(),
    used: integer()
  },
  success: boolean()
}
```

Credits usage response.

# `error_response`

```elixir
@type error_response() :: %{
  success: boolean(),
  error: String.t(),
  errors: map(),
  code: integer()
}
```

Error response.

# `footer`

```elixir
@type footer() :: %{:source =&gt; String.t(), optional(:height) =&gt; String.t()}
```

Footer settings for the generated PDF.

# `header`

```elixir
@type header() :: %{:source =&gt; String.t(), optional(:height) =&gt; String.t()}
```

Header settings for the generated PDF.

# `http_headers`

```elixir
@type http_headers() :: %{required(String.t()) =&gt; String.t()}
```

HTTP headers for requests when loading the source.

# `margin`

```elixir
@type margin() :: %{
  optional(:top) =&gt; String.t(),
  optional(:right) =&gt; String.t(),
  optional(:bottom) =&gt; String.t(),
  optional(:left) =&gt; String.t()
}
```

Margin settings for the generated PDF.

# `pdf_response_headers`

```elixir
@type pdf_response_headers() :: %{
  optional(:&quot;x-pdfshift-processorx&quot;) =&gt; String.t(),
  optional(:&quot;x-process-time&quot;) =&gt; integer(),
  optional(:&quot;x-response-duration&quot;) =&gt; integer(),
  optional(:&quot;x-response-status-code&quot;) =&gt; String.t(),
  optional(:&quot;x-credits-used&quot;) =&gt; integer(),
  optional(:&quot;x-credits-remaining&quot;) =&gt; String.t(),
  optional(:&quot;x-request-id&quot;) =&gt; String.t()
}
```

Response headers from the PDF conversion.

# `protection`

```elixir
@type protection() :: %{
  :owner_password =&gt; String.t(),
  :user_password =&gt; String.t(),
  optional(:author) =&gt; String.t(),
  optional(:no_copy) =&gt; boolean(),
  optional(:no_modify) =&gt; boolean(),
  optional(:no_print) =&gt; boolean()
}
```

Protection settings for the generated PDF.

# `watermark`

```elixir
@type watermark() :: %{
  optional(:image) =&gt; String.t(),
  optional(:text) =&gt; String.t(),
  optional(:font_size) =&gt; integer(),
  optional(:font_family) =&gt; String.t(),
  optional(:font_color) =&gt; String.t(),
  optional(:font_opacity) =&gt; integer(),
  optional(:font_bold) =&gt; boolean(),
  optional(:font_italic) =&gt; boolean(),
  optional(:rotate) =&gt; integer()
}
```

Watermark settings for the generated PDF.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
