firstlookmedia / pdf-redact-tools

a set of tools to help with securely redacting and stripping metadata from documents before publishing
Other
530 stars 50 forks source link

pdf-sanitize dont work with an absolute path to pdf #8

Closed martinlindhe closed 9 years ago

martinlindhe commented 10 years ago

I realize that the script works correctly if i invoke it on a pdf in current directory. when running the script with a full path to the file, i get these errors:

$ pdf-sanitize ~/e-books/First\ Aid\ Made\ Easy.pdf Converting PDF to PNGs convert.im6: unable to open image /home/ml/e-books/First Aid Made Easy_pages//home/ml/e-books/First Aid Made Easy-transparent-0.png': No such file or directory @ error/blob.c/OpenBlob/2638. convert.im6: WriteBlob Failed/home/ml/e-books/First Aid Made Easy_pages//home/ml/e-books/First Aid Made Easy-transparent-0.png' @ error/png.c/MagickPNGErrorHandler/1728. Flattening PNGs Traceback (most recent call last): File "/usr/bin/pdf-explode", line 55, in filename_template = pages_dirname+'/'+filenames[0].replace('-0.png', '-{0}.png') IndexError: list index out of range Converting PNGs to PDF convert.im6: unable to open image /home/ml/e-books/First Aid Made Easy_pages//home/ml/e-books/First Aid Made Easy-*.png': No such file or directory @ error/blob.c/OpenBlob/2638. convert.im6: unable to open file/home/ml/e-books/First Aid Made Easy_pages//home/ml/e-books/First Aid Made Easy-*.png' @ error/png.c/ReadPNGImage/3667. convert.im6: no images defined `/home/ml/e-books/First Aid Made Easy-final.pdf' @ error/convert.c/ConvertImageCommand/3044. Stripping ImageMagick metadata Error: File not found - /home/ml/e-books/First Aid Made Easy-final.pdf 0 image files updated 1 files weren't updated due to errors Traceback (most recent call last): File "/usr/bin/pdf-merge", line 33, in os.remove('{0}_original'.format(output_filename)) OSError: [Errno 2] No such file or directory: '/home/ml/e-books/First Aid Made Easy-final.pdf_original'

micahflee commented 9 years ago

Fixed.