XpCancelDoc(3Xp)
π XpCancelDoc β the "nvm, cancel that doc" era π
okay bestie, welcome to the XpCancelDoc page from the XPRINT FUNCTIONS fam, living in section 3Xp π. This is the function you call when you're mid-print-job and you're like... actually no, we're not doing this anymore. Slay, but cancel it. π
β¨ SYNOPSIS β¨
void XpCancelDoc ( display, discard )
Display *display;
Bool discard;
π¦ ARGUMENTS π¦
displayβ a pointer to theDisplaystructure, which you got back fromXOpenDisplay. iykyk, your whole connection to the X server lives in there πdiscardβ when it'sTRUE, this says that allXPPrintNotifyevents with a detail ofXPEndPageNotifyorXPEndDocNotifyshould be discarded. bye-bye events β¨
πΈ DESCRIPTION πΈ
XpCancelDoc cancels an in-progress document. literally the "stop the presses" of print functions π«Ά
If the job was started with output_mode XPGetData, then the data stream to XpGetDocumentData is interrupted β no further data for the current document will be generated, but data for subsequent documents can still be generated. β¨ That said, heads up: for many page description languages, such arbitrary termination may invalidate the output. it's giving "we stopped midway and the file is now cursed" π
If the job was started with output_mode XPSpool, then depending on the driver and spooler implementation, the entire document may be canceled or a partial document may be generated. no promises, it's implementation-dependent, ngl π
If discard is True, all XPPrintNotify events with a detail field of XPEndPageNotify or XPEndDocNotify are discarded before XpCancelDoc returns. clean sweep, periodt π§Ή
For clients selecting XPPrintMask (see XpSelectInput), the event XPPrintNotify will be generated with its detail field set to XPEndDocNotify. so you do still get told, bestie π
π DIAGNOSTICS π
XPBadContextβ a valid print context-id has not been set prior to making this call. no context, no cancel, sorry babe πXPBadSequenceβ the function was not called in the proper order with respect to the other X Print Service Extension calls (example:XpEndDocprior toXpStartDoc). the vibes were out of order and the server noticed π
π₯ SEE ALSO π₯
XpEndDoc(3Xp)XpGetDocumentData(3Xp)XpSelectInput(3Xp)XpStartDoc(3Xp)
lowkey reminder: cancelling mid-stream with XPGetData can invalidate the output for many page description languages β it's right there in the description, so don't come for me π
π that's the whole page, you ate, no cap π
sign-off era: this iconic little number ships with X Version 11, libXp 1.0.4, dated XpCancelDoc(3Xp) β catch you in the man pages, bestie ππ¦π
π¦ where this page comes from
- arch rolling: libxp 1.0.4-3 Β· X11 AND X11-distribute-modifications-variant
- nixos 26.05: libxp 1.0.4
- nixpkgs unstable: libxp 1.0.4
- opensuse-leap 16.0: libXp-devel 1.0.4-bp160.1.12 Β· MIT
- opensuse-leap 16.0: libXp-devel 1.0.4-bp160.1.12 Β· MIT
- opensuse-leap 16.0: libXp-devel 1.0.4-bp160.1.12 Β· MIT
- opensuse-leap 16.0: libXp-devel 1.0.4-bp160.1.12 Β· MIT
- Copyright 1996 Hewlett-Packard Company
- Copyright 1996 International Business Machines Corp
- Copyright 1996, 1999, 2004, Oracle and/or its affiliates. All rights reserved
- Copyright 1996 Novell, Inc
- Copyright 1996 Digital Equipment Corp
- Copyright 1996 Fujitsu Limited
- Copyright 1996 Hitachi, Ltd
- Copyright 1996 X Consortium, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms