sphinx_evita.pdfembed

Examples

:::{pdfembed} _static/path/to/file.pdf
:height: 500px
:width: 100%
:align: center
:::

Provides the pdfembed directive implemented in PDFEmbedDirective.

Module Contents

Classes

pdfembed

PDFEmbedDirective

Directive to embed a PDF via iframe.

Functions

setup

  • evita_pdfembed_html_tag which defaults to "iframe". This means that an <iframe ...></iframe> HTML tag will be used to embed the PDF. Alternative value is "object" tag which embeds using an <object></object>.

align_spec

Supported values for :align: are left, center, right.

html_visit_pdfembed

Embed in HTML using object or iframe.

latex_visit_pdfembed

Embed PDF using \includepdf. Assumes user loads pdfpages package in preamble.

Data

API

sphinx_evita.pdfembed.setup(app: sphinx.application.Sphinx) dict[str, Any]
  • evita_pdfembed_html_tag which defaults to "iframe". This means that an <iframe ...></iframe> HTML tag will be used to embed the PDF. Alternative value is "object" tag which embeds using an <object></object>.

sphinx_evita.pdfembed.logger

‘getLogger(…)’

class sphinx_evita.pdfembed.pdfembed(rawsource='', *children, **attributes)

Bases: docutils.nodes.General, docutils.nodes.Element

sphinx_evita.pdfembed.align_spec(argument) str

Supported values for :align: are left, center, right.

class sphinx_evita.pdfembed.PDFEmbedDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)

Bases: sphinx.util.docutils.SphinxDirective

Directive to embed a PDF via iframe.

pdfembed options

:height: length

The height of the PDF embed. Defaults to 550vh.

:width: length or percentage

The width of the PDF embed. Defaults to 100%.

:align:

The alignment of the PDF embed. Defaults to center.

:title: text

The title of the PDF embed. Defaults to simply, PDF.

:frameborder: integer

The frameborder of the PDF embed. Defaults to 1.

:scrolling: text

The scrolling of the PDF embed. Defaults to auto.

:style: text

The style of the PDF embed. Defaults to a thin solid border.

Initialization

has_content

False

required_arguments

1

optional_arguments

0

final_argument_whitespace

False

option_spec

None

run()
sphinx_evita.pdfembed.html_visit_pdfembed(self, node)

Embed in HTML using object or iframe.

sphinx_evita.pdfembed.latex_visit_pdfembed(self, node)

Embed PDF using \includepdf. Assumes user loads pdfpages package in preamble.