pdftitle
pdftitle copied to clipboard
feat: pass args via run
Fixes #33
This should be the most minimal-invasive way of passing arguments to pdftitle when calling it from another python module. It allows the module to be used in conjunction with contextlib as shown in the following example
import pdftitle
from contextlib import redirect_stdout
import io
with redirect_stdout(io.StringIO()) as s:
pdftitle.run(['-p', file_path, '-a', 'max2'])
title = s.getvalue()
Actually I didnt plan pdftitle to be embedded or used as a library, it is a command line utility, so none of such uses are considered. However, it seems there is an interest in this but I probably have to change more.