Last active
November 12, 2022 08:15
-
-
Save SKaplanOfficial/6394b424fb5773224ca19c7756f16255 to your computer and use it in GitHub Desktop.
Printing a TextEdit document with print settings in PyXA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tested with PyXA 0.1.0 | |
import PyXA | |
from datetime import datetime, timedelta | |
app = PyXA.Application("TextEdit") | |
doc = app.documents()[0] | |
print_time = datetime.now() + timedelta(minutes=1) | |
properties = { | |
"copies": 3, | |
"collating": False, | |
"startingPage": 1, | |
"endingPage": 10, | |
"pagesAcross": 3, | |
"pagesDown": 3, | |
"requestedPrintTime": print_time, | |
"errorHandling": app.PrintErrorHandling.DETAILED.value, | |
"faxNumber": "", | |
"targetPrinter": "" | |
} | |
app.print(doc, print_properties=properties) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment