Skip to content

Feat: Introducing Printing on Windows - #21988

Open
Cjhemmer wants to merge 72 commits into
darktable-org:masterfrom
Cjhemmer:master
Open

Feat: Introducing Printing on Windows#21988
Cjhemmer wants to merge 72 commits into
darktable-org:masterfrom
Cjhemmer:master

Conversation

@Cjhemmer

@Cjhemmer Cjhemmer commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Windows Printing has been lacking from Darktable. I have implemented a working print module, building upon the work already in the base code. The majority of changes occur in two files.

libs/print_settings.c which has been modified with _WIN32 guarded code except for rare instances where a change made sense for all platforms. This scaffolds onto the existing code base the functions necesary to keep the Windows print ticket and device mode (DEVMODE) up to date as settings are changed.
The other is a new file, win/win32_print.c (along with its header) which attempts to mirror the functionality of common/cups_print.c. cups_print.c is not included in the cmake though, only the header to cover compiling the cross platform print_settings. It handles printer discovery, DEVMODE enumeration, and print job creation.
CMake files are modified to enable the Print module on a WIndows build.
A minor edit was also made to instantiate pos in printing.c as it was throwing a compile error on in MSYS2.
A minor edit was made to cups_print.h to add a paper_id variable that is specific to my Windows structure but might be useful for all platforms.

I have tested this with a modern Epson inkjet, older Canon laser all in one, and Microsoft Print to PDF with success. It leverages the XPS print API for print job creation, so very old printers may not work, but i found xps to be far faster than GDI printing. I only have physical access to the two listed to test.

Print pipeline is fully color managed and prints directly to the printer, not relying on an external utility which may or may not respectcembedded color profiles, like PDF printing does on Windows.

@TurboGit
TurboGit marked this pull request as draft August 29, 2026 22:12
Cjhemmer added a commit to Cjhemmer/darktable-WindowsPrinting that referenced this pull request Sep 1, 2026
@Cjhemmer

Cjhemmer commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Ready for review once again. Release notes update pending review completion. I think this might be considered a "big one" but please advise.

@Cjhemmer
Cjhemmer marked this pull request as ready for review September 1, 2026 16:35
@TurboGit

TurboGit commented Sep 1, 2026

Copy link
Copy Markdown
Member

@Cjhemmer : I'll review this soon. And yes this is definitely a BIG ONE, thanks!

@TurboGit TurboGit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After a new pass on the code, some comments/changes.

Also, can you squash all commits together when pushing the changes, TIA.

Comment thread src/libs/CMakeLists.txt Outdated
Comment thread src/views/CMakeLists.txt Outdated
Comment thread src/libs/print_settings.c Outdated
Comment thread src/libs/print_settings.c Outdated
Comment thread src/libs/print_settings.c Outdated
Comment thread src/win/win32_print.h Outdated
Comment thread src/CMakeLists.txt Outdated
Comment thread src/CMakeLists.txt
Comment thread src/win/win32_print.h Outdated
Comment thread CMakeLists.txt Outdated
@Cjhemmer
Cjhemmer force-pushed the master branch 2 times, most recently from 5305732 to 7597da1 Compare September 3, 2026 01:54
@Cjhemmer

Cjhemmer commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

After a new pass on the code, some comments/changes.

Also, can you squash all commits together when pushing the changes, TIA.

I made the requested changes and then tried to do some squashing of commits, which in my unfamilarility with git I made an complete mess of instead. Sorry about that. I ended up reverting back and rebuilding my commits up, but the mess remains in the record. Final files to review should be clean though.

Let me know if you have any further questions, comments, or when it is time to update the RELEASE_NOTES

@TurboGit TurboGit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor style comments. Apart from that looks good.

@wpferguson : I can't test myself, can you do some testing for this new feature?

Comment thread src/common/printing.h Outdated
Comment thread src/libs/print_settings.c Outdated
@TurboGit

TurboGit commented Sep 3, 2026

Copy link
Copy Markdown
Member

@Cjhemmer : You can update the release notes now I would say. TIA.

@Cjhemmer
Cjhemmer requested a review from TurboGit September 3, 2026 16:47
@anoderay anoderay added the documentation: pending a documentation work is required label Sep 3, 2026

@TurboGit TurboGit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last comment from me, let's get some feedback from @wpferguson after testing. Really thanks for the work @Cjhemmer, nice to see Windows to be on par with other platforms.

Comment thread RELEASE_NOTES.md Outdated
@Cjhemmer
Cjhemmer requested a review from TurboGit September 3, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation: pending a documentation work is required feature: new new features to add scope: print all cups and printing related issues scope: windows support windows related issues and PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants