XpStartDoc(3Xp)
πΈ NAME πΈ
XpStartDoc β indicates the beginning of a print document. thatβs the whole name section, bestie, short and iconic π
this page is XpStartDoc(3Xp) from the XPRINT FUNCTIONS manual, so weβre folding the header in up top instead of copying it like a robot π«Ά
β¨ SYNOPSIS β¨
the whole call looks like this, no cap:
cc [ flag... ] file... -lXp [ library... ]
#include <X11/extensions/Print.h>
void XpStartDoc ( display, type )
Display *display;
XPDocumentType type;
π¬ ARGUMENTS π¬
displayβ specifies a pointer to theDisplaystructure; returned fromXOpenDisplay. yes, thatDisplaystructure, the one fromXOpenDisplayπtypeβ specifies the type of document. it can be eitherXPDocRaworXPDocNormalπ
π¦ DESCRIPTION π¦
XpStartDoc signals the beginning of a new print document. periodt.
if type is XPDocRaw, then the client will provide all the data for the resulting document using XpPutDocumentData; the X Print Server will not write any data into the resulting document. calling XpStartPage in a XPDocRaw document will generate an XPBadSequence error. for more information, see XpPutDocumentData. okay so raw mode means the client is fully in charge of the data, and the server is not adding its own data into the resulting document, bestie π
if type is XPDocNormal, then the X Print Server will generate document data, and depending on the DDX driver, can incorporate additional data from XpPutDocumentData into the output. for more information, see XpPutDocumentData. so normal mode lets the server generate stuff and maybe mix in extra data depending on the DDX driver, iykyk π
all changes to the XPDocAttr attribute pool (see XpSetAttributes) must be made prior to calling XpStartDoc, after which an XPBadSequence will be generated if changes are attempted, until XpEndDoc is called. so lock in those XPDocAttr changes before XpStartDoc, or the sequence is gonna be mad at you π
the application is not required to call XpStartDoc and XpEndDoc in the process of printing. the "document" delineation may not be useful from the application's or spooler's perspective, hence is optional. itβs giving βoptional eraβ π
if XpStartPage is called immediately after XpStartJob then a synthetic XpStartDoc with XPDocNormal will be assumed by the X Print Server prior to XpStartPage (i.e. the XPStartDocNotify and XPStartPageNotify events will have the same sequence number). likewise, if XpEndJob is called immediately after XpEndPage then a synthetic XpEndDoc will be assumed by the X Print Server prior to XpEndJob (i.e., the XPEndDocNotify and XPEndJobNotify events will have the same sequence number). so yes, the server can quietly assume a synthetic doc when you skip the explicit calls β and the sequence numbers will match up like besties matching outfits π
for clients selecting XPPrintMask (see XpSelectInput), the event XPPrintNotify will be generated with its detail field set to XPStartDocNotify. thatβs the event heads-up, okay? π
π§ STRUCTURES π§
the XPDocumentType values are defined in <X11/extensions/Print.h>:
#define XPDocNormal 1 /β Doc data handled by Xserver*/
#define XPDocRaw 2 /β Doc data passed through Xserver*/
π DIAGNOSTICS π
XPBadContextβ a valid print context-id has not been set prior to making this call. not me forgetting the context-id πXPBadSequenceβ the function was not called in the proper order with respect to the other X Print Service Extension calls (example,XpEndDocprior toXpStartDoc). sequence matters, bestie, always πBadValueβ the value specified fortypeis not valid. thattypedid not pass the vibe check π
π FILES π
<X11/extensions/Print.h>
π₯ SEE ALSO π₯
XpEndDoc(3Xp)XpEndJob(3Xp)XpEndPage(3Xp)XpPutDocumentData(3Xp)XpSelectInput(3Xp)XpSetAttributes(3Xp)XpStartJob(3Xp)XpStartPage(3Xp)
thatβs the page, bestie π«Ά this icon is from X Version 11, libXp 1.0.4, and the footer didnβt give us a date, so weβre just gonna vibe with that πΈβ¨ XpStartDoc(3Xp) out π
π¦ 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