简体   繁体   中英

How can I compress a pdf in a different directory using ghostscript command?

How can I compress a pdf in a different directory using the command below?:

ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

/books/input.pdf instead of input.pdf Doesn't compress the input.pdf which is in the /books directory.

I am using ghostscript4js in my node app to compress pdf using the commands but the pdf needs to be at the same directory as the server.js file to be able to compress it. Since I want to keep my pdfs in a separate directory (ie /books) I wonder how can I do that? And also can I output into a different directory?

/books/input.pdf 不起作用,我应该使用的是./books/input.pdf

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM