configurable output temp dir

master
bel 2023-02-21 12:51:28 -07:00
parent ca2f4c0fac
commit 689998d71f
2 changed files with 4 additions and 1 deletions

View File

@ -96,7 +96,8 @@ class Chars:
modified_page.mediabox.lower_right = (bounds.x0, bounds.y1)
modified_page.mediabox.lower_left = (bounds.x1, bounds.y1)
modified_writer.add_page(modified_page)
modified_path = "/tmp/{}-{:03d}-{}.modified.pdf".format(
modified_path = "{}/{}-{:03d}-{}.modified.pdf".format(
config.TEMP_DIR,
self.path.split("/")[-1],
self.page.page_number,
j,

View File

@ -4,3 +4,5 @@ DEBUG = os.environ.get("DEBUG", "")
DEBUG_NO_SHOW = os.environ.get("DEBUG_NO_SHOW", "")
DEBUG_HEIGHT = int(os.environ.get("DEBUG_HEIGHT", "800"))
INPUT = os.environ.get("INPUT", "./testdata/input.pdf")
TEMP_DIR = os.environ.get("TEMP_DIR", "/tmp/dnd-pdf-to-txt.d")
os.makedirs(TEMP_DIR, exist_ok=True)