-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
30 lines (22 loc) · 679 Bytes
/
Copy pathrun.py
File metadata and controls
30 lines (22 loc) · 679 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"""Entry point for PDF Crop Studio.
Usage:
python run.py # open the app, then pick a PDF from the UI
python run.py path/to.pdf # open the app with that PDF already loaded
"""
import sys
import tkinter as tk
from pdfcrop.app import ExtractorApp
def main():
pdf_path = sys.argv[1] if len(sys.argv) > 1 else None
root = tk.Tk()
root.title("PDF Crop Studio")
# Crisp rendering on high-DPI Windows displays.
try:
from ctypes import windll
windll.shcore.SetProcessDpiAwareness(1)
except Exception:
pass
ExtractorApp(root, pdf_path=pdf_path)
root.mainloop()
if __name__ == "__main__":
main()