## What did you do? I created a PDFDocument, and rendered it. When the preview was displayed in Mail for macOS, the background was transparent. ## What did you expect to happen? I expected the background to be white, or a a possibility to set a fill coloraturas ## What happened instead? The background was transparent ## TPPDF Environment **TPPDF version:** 2.3.1 ℹ **Xcode version:** 12 ℹ **Swift version:** 5 ℹ ## Demo Code / Project ``` let document = PDFDocument(format: .a4) document.set(font: Font.systemFont(ofSize: 12)) document.add(text: "Hello World") let generator = PDFGenerator(document: document) do { return try generator.generateURL(filename: "Utlånserklæring.pdf") } catch { print(error) } ```
Activity
philprime commentedon Dec 2, 2020
Hi there! Thanks for opening up this issue.
This should definitely be a feature so it is possible to set a paper/background color.
philprime commentedon May 13, 2021
I am thinking about looking further into this and therefore RFC:
API
First off I would add a property
backgroundto thePDFDocumentclass with the following structure:This allows to add more background alternatives further down the road as they can easily be added next to
color.Example:
audungk commentedon May 18, 2021
Sensible! Looks good to me!
philprime commentedon May 22, 2021
I created a pull request PR #277.
Can you please test it?
stefanovnt commentedon Aug 24, 2021
I am really interested in this feature, I have tested it and it's working correctly for me 👌
philprime commentedon Aug 25, 2021
@stefanovnt thank you for your feedback!
I will go ahead and review the PR once more and merge it soon