Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/nbconvert/exporters/qtpdf.py: 100%

6 statements  

« prev     ^ index     » next       coverage.py v7.2.7, created at 2023-07-01 06:54 +0000

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" # noqa 

20 

21 paginate = Bool( 

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)