Skip to content

xeonliu/RustPrinter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RupmPrinter

RupmPrinter is designed to be a multi-platform printer server & frontend application for SJTU Library Printing System.

It is a reversed version of the official UPMClient Windows driver from Unifound.

R as in Rust/Reverse/Rewrite.

It works as a Sockets Server, a PCL Interpreter and a Frontend Client on Windows/Linux/MacOS.

On Windows it can also work as a patch of the original client.

Usage

Windows

As a Patch

  1. Rename RustPrinter.exe to UPMPrinter.exe
  2. Replace C:\upmclient\UPMPrinter.exe with the new one.

As a Server

Unix-like Systems

  1. Install CUPS (Usually preinstalled)
  2. Register the printer (Please make sure port 6981 is available)
lpadmin -p RupmPrinter -E -v socket://127.0.0.1:6981 -m drv:///sample.drv/laserjet.ppd

Note: You can change the PPD file to other PCL5 compatible files.

  1. Run the client
  2. Choose RupmPrinter as target when printing

MacOS

Same as Unix-like Systems

Manually Set up in Settings

Tasks

  • 判断客户端上传是否一定需要IP地址作为目标:不用
  • 首先读取Cookie, 使用Auth/Check判断或者获取新Cookie
  • 使用GetAuthToken获取szToken,用于构建二维码。
  • 手机扫码访问UniAuth.aspx界面进行授权
  • 可以使用阻塞的HTTP访问判断是否授权完成
  • 此时Cookie生效,使用Auth/Check可以判断
  • 持久化Cookie
  • 后续可以随意调用API。
  • 从打印任务中获取必要信息
  • 发送HTTP请求,创建Job
  • 使用Compress.dll压缩PJL文件Use gzip.
  • 发送HTTP请求,上传文件
  • 发送结束请求
  • 清除打印队列内容和临时文件。
  • 类Unix系统支持
    • 编写CUPS Backend
    • 编写PPD文件
    • Use Socket Backend
    • PCL Intepretation (GhostPDL?)
  • 查看当前在线队列
  • 查询历史打印信息
  • 使用IPP提供服务
  • 接入网页端PDF上传接口

Dependencies

  • GhostPCL(PDL): AGPL 3.0

License

AGPL 3.0

Build

Checkout GitHub Action Files

About

UPMPrinter reimplemented in Rust

Resources

License

Stars

Watchers

Forks

Packages

No packages published