Bug 95445 - Add an event to trigger an action after printing a document
Summary: Add an event to trigger an action after printing a document
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Macro
  Show dependency treegraph
 
Reported: 2015-10-30 12:43 UTC by GUTH Christophe
Modified: 2023-05-10 15:55 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description GUTH Christophe 2015-10-30 12:43:13 UTC
Hello,

I work on calc document with multiple sheets. To print, i sometimes need to select 2 or 3 sheets and print them at once (for page numbering). But if i forgot to deselect the sheets and if i modify a cell, I lose the content of the cell on the other sheets (not only the active sheet).

My idea was to put a macro on the OnPrint event of the document, but this event is called before LibreOffice starts actually the print job. If i change the selected sheets at this time, I can't be sure of the result.

The best way would be to start the macro on key press (but there is no event related to this), or to start the macro after printing (to automaticaly deselect the selected sheets after printing), but there is no event OnPrintEnd.

Is there a way to add such event ?

Thanks
Comment 1 Cor Nouws 2015-11-02 10:09:42 UTC
Thanks for the idea, Christophe. Set this to New
Comment 3 Mike Kaganski 2023-05-10 15:55:22 UTC
Please see bug 117280. The event is emitted twice, and the said bug implemented passing the status in the supplement field of the passed argument. I suppose, this should be enough, with the code being able to disambiguate when the status is JOB_SPOOLED and JOB_ABORTED, from the JOB_STARTED case.