Skip to content

Commit bf78cc8

Browse files
authored
Merge pull request #288 from ilyalehchylin/bug/pdf-export-dark-mode
Fix PDF export in dark mode (#231)
2 parents 093fd84 + b5f0cc1 commit bf78cc8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Sources/PulseUI/Helpers/TextUtilities.swift

+7
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,13 @@ enum TextUtilities {
111111
let bounds = UIGraphicsGetPDFContextBounds()
112112
for i in 0 ..< renderer.numberOfPages {
113113
UIGraphicsBeginPDFPage()
114+
115+
if isDarkMode, let context = UIGraphicsGetCurrentContext() {
116+
let backgroundColor = UIColor(red: 44/255.0, green: 42/255.0, blue: 40/255.0, alpha: 1.0)
117+
context.setFillColor(backgroundColor.cgColor)
118+
context.fill(bounds)
119+
}
120+
114121
renderer.drawPage(at: i, in: bounds)
115122
}
116123
UIGraphicsEndPDFContext()

0 commit comments

Comments
 (0)