New pages
Jump to navigation
Jump to search
- 19:06, 25 August 2022 Node.js: STDIN (hist | edit) [319 bytes] 200.201.163.25 (talk) (Created page with "<pre> var stdin = process.openStdin(); stdin.addListener("data", function(d) { // note: d is an object, and when converted to a string it will // end with a linefeed. so we (rather crudely) account for that // with toString() and then trim() console.log("you entered: [" + d.toString().trim() + "]"); }); </pre>")
- 18:08, 25 August 2022 Python: PDF Image Extractor (hist | edit) [859 bytes] 200.201.163.25 (talk) (Created page with "<pre> import os import sys import logging import subprocess from PIL import Image, ImageSequence def extract_pdf_images(filepath, directory, ghostscript_path): cwd = r'.' cmd = r'{gs_path} -o "{directory}\p-%03d-000.png" -sDEVICE=png16m -dNOSAFER -r300 {filepath}'.format(gs_path=ghostscript_path, directory=directory, filepath=filepath) subprocess.check_output(cmd, cwd=cwd, shell=True) #def extract_tif_images(filepath, directory): # im = Image....")