1"""Export to PDF via a headless browser"""
2
3# Copyright (c) IPython Development Team.
4# Distributed under the terms of the Modified BSD License.
5
6from traitlets import Bool
7
8from .qt_exporter import QtExporter
9
10
11class QtPDFExporter(QtExporter):
12 """Writer designed to write to PDF files.
13
14 This inherits from :class:`HTMLExporter`. It creates the HTML using the
15 template machinery, and then uses pyqtwebengine to create a pdf.
16 """
17
18 export_from_notebook = "PDF via HTML"
19 format = "pdf"
20
21 paginate = Bool( # type:ignore[assignment]
22 True,
23 help="""
24 Split generated notebook into multiple pages.
25
26 If False, a PDF with one long page will be generated.
27
28 Set to True to match behavior of LaTeX based PDF generator
29 """,
30 ).tag(config=True)