Print directly to default printer without print dialog

Asked by Isaac Smith

I'm building a web-based check-in kiosk using Midori on a Raspberry Pi, and will need to print directly to the system default printer from a web page. Right now, I get the standard printing dialog box when trying to print, is there a way to make Midori print without showing the dialog? Firefox and LibreOffice can both do this, so I know it's possible.

Question information

Language:
English Edit question
Status:
Solved
For:
Midori Web Browser Edit question
Assignee:
No assignee Edit question
Solved by:
Isaac Smith
Solved:
Last query:
Last reply:
Revision history for this message
Isaac Smith (hunternet93) said :
#1

It looks like printing without showing a dialog is actually pretty simple, assuming Midori uses GTK's print API. It looks like you just pass GTK_PRINT_OPERATION_ACTION_PRINT instead of GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG to the gtk_print_operation_run() function. I might attempt to make a patch if my meager coding skills are up to the task.

Revision history for this message
Isaac Smith (hunternet93) said :
#2

I eventually managed to add the option to Midori, I've uploaded branch https://code.launchpad.net/~hunternet93/midori/print-without-dialog and requested a review for merging into main.