s2c-code-share

Automation Script Example: Converting Raster PDFs

Dec 11th, 2020
264
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. in_dir = "path/to/input_directory"
  2. pdfs = s2c.list(in_dir, "pdf")
  3. for p in pdfs:
  4.     pp = p.open()
  5.     pp.save(s2c.FileType.RASTER, s2c.join(in_dir, p.get_name()))
  6. preset = s2c.Preset()
  7. imgs = s2c.list(in_dir, "pcx")
  8. for i in imgs:
  9.     r = i.open()
  10.     v = r.vectorize(preset)
  11.     v.save(r.path)
RAW Paste Data