Skip to content

Commit

Permalink
feat: add lp print cmd
Browse files Browse the repository at this point in the history
Signed-off-by: Dup4 <[email protected]>
  • Loading branch information
Dup4 committed Dec 14, 2023
1 parent a4c8779 commit fc20f4d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions printer_client/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import requests
import json
import typst
import subprocess

import constants

Expand Down Expand Up @@ -86,6 +87,10 @@ def handle_print_task(task):

typst.compile(typst_path, output=pdf_path)

cmd = "lp -o charset=UTF-8 -o print-quality=5 -P 1-10 {}".format(
pdf_path)
subprocess.run(cmd, shell=True)

done(print_task_id)
except Exception as e:
print("handle print task error. [error={}]".format(e))
Expand Down

0 comments on commit fc20f4d

Please sign in to comment.