如何查找打印用户的用户名或将其添加到使用 XPSDrv 打印的 XPS

发布于 2024-10-20 07:02:11 字数 162 浏览 10 评论 0原文

有谁知道是否有一种简单方法可以在使用 XPSDrv 时将打印用户的用户名包含在 XPS 包中或驱动程序数据流中的任何标头中可访问的位置?通过在过滤器管道中使用过滤器(尽管在我看来这并不简单)?通过读取 TCP/IP 标头值?我用谷歌搜索了我的手指短试图找到一个合理的解决方案。

Does anyone know if there is a simple way to include the username of the printing user somewhere accessible either in the XPS package or in any header in the data stream from the driver when using XPSDrv? By using a filter in the filter pipeline (even though it is not simple in my opinion)? By reading TCP/IP header values? I have googled my fingers short trying find a reasonable solution.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

眼角的笑意。 2024-10-27 07:02:11

简单的?不,不是真的。最好的选择可能是修改 XPS 驱动程序中的过滤器以执行以下操作:

  1. 使用 XPS_FP_USER_TOKEN 键从管道的属性包中提取用户令牌。
  2. 使用 GetTokenInfo
  3. 使用 LookupAccountSID
  4. 将用户名添加到打印票据中。为了使事情尽可能简单,我建议重用公共模式中的字段,例如 JobComment ParameterInit。

这一切只是一个起点。我怀疑您需要深入研究 XPS 驱动程序的工作原理才能使其成为可靠的解决方案。

Simple? No, not really. Your best bet is probably to modify a filter in your XPS driver to do the following:

  1. Extract the user token from the pipeline's property bag using the XPS_FP_USER_TOKEN key.
  2. Get the user's SID from the token using GetTokenInfo
  3. Get the username from the SID using LookupAccountSID
  4. Add the username to the print ticket. To keep things as simple as possible, I'd suggest reusing a field from the public schema, such as the JobComment ParameterInit.

This is all just a starting point. I suspect you're going to need to delve into the details of how an XPS driver works in order to make this a reliable solution.

云巢 2024-10-27 07:02:11

您可以将元数据存储在 XPS(核心属性)中,或者您也可以使用打印票证来实现此目的。

You can store meta data in de the XPS (Core Properties), or you could probably use the print ticket for this purpose too.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文