hkdb / cpdf Goto Github PK
View Code? Open in Web Editor NEWA script to simplify compressing PDF file size with GhostScript
License: MIT License
A script to simplify compressing PDF file size with GhostScript
License: MIT License
I'm getting this error when trying to use the module:
Traceback (most recent call last):
File "/bin/cpdf", line 19, in <module>
import os, datetime, sys, glob, re, subprocess, pyprind, time
ModuleNotFoundError: No module named 'pyprind'
The pyprind
module in imported, but is not installed with install.sh
or mentioned in the README. This gives me the following error:
l@l ~> cpdf
/usr/local/bin/cpdf:65: SyntaxWarning: invalid escape sequence '\`'
if re.search('[|;\`><{}#*]', inFile):
/usr/local/bin/cpdf:66: SyntaxWarning: invalid escape sequence '\`'
print("\n" + '\033[91m' + "ERROR:" + '\033[0m' + " Input file contains invalid characters such as | ; \` > < } { # *.... Exiting...\n")
/usr/local/bin/cpdf:70: SyntaxWarning: invalid escape sequence '\`'
if re.search('[|;\`><{}#*]', outFile):
/usr/local/bin/cpdf:71: SyntaxWarning: invalid escape sequence '\`'
print("\n" + '\033[91m' + "ERROR:" + '\033[0m' + " Output file contains invalid characters such as | ; \` > < } { # *.... Exiting...\n")
Traceback (most recent call last):
File "/usr/local/bin/cpdf", line 19, in <module>
import os, datetime, sys, glob, re, subprocess, pyprind, time
ModuleNotFoundError: No module named 'pyprind'
You do not appear to be escaping your filenames and then your pass the values to shell=True
, which will likely lead to an exploit AFAICT. ๐
When I attempt to get help information, some of the important text doesn't appear on in my terminal window (which uses a white background). Attached is a screenshot of how it appears on my screen.
It would be nice if the text had some method of emphasis other than assuming a dark colored background.
Thanks for this excellent tool!
Pm
Hello,
when using the script on windows (I didn't try it on Linux) when specifying an input file which is not in the same directory as the script itself, the script complains about illegal characters such as the directory delimiters \
and /
.
Is there any possibility to specify an input file, which is stored in another directory?
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.