XpPutDocumentData(3Xp)

πŸ’– XpPutDocumentData πŸ’–

okay so bestie, welcome to the 3Xp page from XPRINT FUNCTIONS. this is the whole XpPutDocumentData story, and it’s giving β€œsend data and incorporate it into the output” main character energy. 🫢 no cap, every detail is still here.


πŸŽ€ NAME πŸŽ€

void XpPutDocumentData - Sends and incorporates data into the output.


✨ SYNOPSIS ✨

bestie, the compile-and-call vibe is literally this:

             cc [ flag... ] file... -lXp [ library... ]
             #include <X11/extensions/Print.h>

       XpPutDocumentData ( display, drawable, data, data_len, doc_fmt, options
       )
             Display *display;
             Drawable drawable;
             unsigned char *data;
             int data_len;
             char *doc_fmt;
             char *options;

🫢 ARGUMENTS 🫢

  • display β€” a pointer to the Display structure; you get it back from XOpenDisplay. iconic little handoff, honestly.
  • drawable β€” the destination drawable for rendering. that’s where the output energy goes.
  • data β€” the device-specific data being sent. yes, this is the actual payload.
  • data_len β€” the number of bytes in data.
  • doc_fmt β€” the type of data sent. peek below for valid values. string limited to XPCS characters.
  • options β€” DDX driver dependent options. string limited to XPCS characters.

πŸ’… DESCRIPTION πŸ’…

Depending on the type for XpStartDoc, XpPutDocumentData has two modes of operation. periodt.

In XPDocRaw mode, XpPutDocumentData sends data directly to the output, and drawable must be None β€” else a BadDrawable error is generated. 🚨

🚨 raw-mode vibe check: bestie, drawable MUST be None. not optional. not a suggestion.

The X Print Server does not emit document or page control codes into the output, and data is passed through unmodified. This is useful for sending previously constructed and completed documents using the X Print Server job control and submission capabilities.

The printer attribute xp-raw-formats-supported defines the valid values for doc_fmt in this mode. Unsupported values for doc_fmt cause a BadMatch error to be generated.

In XPDocNormal mode, XpPutDocumentData sends data to the X Print Server, and depending on the DDX driver implementation, integrates data into the output. The parameters doc_fmt and options describe the format of data, which guides the DDX driver in interpreting data.

The printer attribute xp-embedded-formats-supported defines the valid values for doc_fmt in this mode, with unsupported values for doc_fmt causing a BadMatch error to be generated.

If doc_fmt is not in either xp-raw-formats-supported or xp-embedded-formats-supported a BadValue error is generated. πŸ’€

Depending on the DDX driver implementation in use, XpPutDocumentData might be used, for example, to send a simple text file to a Postscript DDX driver that is capable of wrapping the appropriate document and page control constructs around the text so that it can be printed on a Postscript printer. Likewise, Encapsulated Postscript Files might be handled. Another use could be to send a TIFF file to a PCL DDX driver that can convert the image from TIFF into PCL and then integrate it into the current PCL output. it’s giving format glow-up, honestly.

There is no limit to the value of data_len. XpPutDocumentData automatically decomposes the call into multiple protocol requests to make sure that the maximum request size of the server is not exceeded. πŸ¦‹


🚨 DIAGNOSTICS 🚨

  • BadDrawable β€” The value specified for drawable is not valid.
  • BadMatch β€” The value specified for doc_fmt is not valid for the current document type or the value specified for is not valid for the print context and print screen.
  • BadValue β€” The value specified for doc_fmt is not supported.
  • XPBadContext β€” A valid print context-id has not been set prior to making this call.
  • XPBadSequence β€” The function was not called in the proper order with respect to the other X Print Service Extension calls (for example, XpPutDocumentData prior to XpStartDoc).

πŸ‘€ SEE ALSO πŸ‘€

  • XpStartDoc(3Xp) β€” the see-also bestie. obviously.

πŸ’– okay that’s the whole page, bestie. cute little sign-off: X Version 11, libXp 1.0.4 β€” and yes, the page title energy is XpPutDocumentData(3Xp). periodt. 🫢

πŸ“¦ where this page comes from