Skip to content

Commit

Permalink
Merge pull request #288 from ilyalehchylin/bug/pdf-export-dark-mode
Browse files Browse the repository at this point in the history
Fix PDF export in dark mode (#231)
  • Loading branch information
kean authored Sep 4, 2024
2 parents 093fd84 + b5f0cc1 commit bf78cc8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Sources/PulseUI/Helpers/TextUtilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ enum TextUtilities {
let bounds = UIGraphicsGetPDFContextBounds()
for i in 0 ..< renderer.numberOfPages {
UIGraphicsBeginPDFPage()

if isDarkMode, let context = UIGraphicsGetCurrentContext() {
let backgroundColor = UIColor(red: 44/255.0, green: 42/255.0, blue: 40/255.0, alpha: 1.0)
context.setFillColor(backgroundColor.cgColor)
context.fill(bounds)
}

renderer.drawPage(at: i, in: bounds)
}
UIGraphicsEndPDFContext()
Expand Down

0 comments on commit bf78cc8

Please sign in to comment.