I currently have a Python script that runs a Ghostscript command to convert a PDF's first page to a PNG. However, right now the image just goes into one of my directories. Is it possible to have the Ghostscript output binary data so I can save that save to a database?
args = [
"pdf2img", # actual value doesn't matter
"-sOutputFile=testing.png",
"-dNOPAUSE",
"-dBATCH",
"-sDEVICE=png256",
"-sPAPERSIZE=a1",
"-dPDFFitPage=true",
"-dFirstPage=1",
"-dLastPage=1",
"testPDF.pdf"
]
ghostscript.Ghostscript(*args)