--- a/src/eric7/QScintilla/Exporters/ExporterPDF.py Tue Nov 08 11:50:50 2022 +0100 +++ b/src/eric7/QScintilla/Exporters/ExporterPDF.py Tue Nov 08 12:19:25 2022 +0100 @@ -11,7 +11,7 @@ # Original code: Copyright 1998-2006 by Neil Hodgson <neilh@scintilla.org> from PyQt6.Qsci import QsciScintilla -from PyQt6.QtGui import QFontInfo +from PyQt6.QtGui import QColor, QFontInfo from eric7 import Preferences from eric7.EricGui.EricOverrideCursor import EricOverrideCursor @@ -513,6 +513,9 @@ style.font |= 1 colour = lex.color(istyle) + if colour.name() == "#ffffff": + # map white to black for readability on paper + colour = QColor("#000000") style.fore = self.__getPDFRGB(colour) self.pr.style[istyle] = style @@ -635,3 +638,17 @@ """ <b>{0}</b>.</p><p>Reason: {1}</p>""" ).format(filename, str(err)), ) + + +def createExporter(editor, parent=None): + """ + Function to instantiate an exporter object. + + @param editor reference to the editor object + @type QScintilla.Editor.Editor + @param parent parent object of the exporter (defaults to None) + @type QObject (optional) + @return exporter object + @rtype ExporterPDF + """ + return ExporterPDF(editor, parent=parent)