Wikipedia:Reference desk/Archives/Computing/2018 April 21

= April 21 =

Adobe Reaper help, Windows.
I've been receiving .PDF files of images where they blank out certain parts, like with a black square or rectangle.

How do you remove those?

When I 1st open the file, I see the image in it's entirety for a split second, and then the blank covering cover up.

I read in a newspaper there was a trick to remove them. :/

Thanks. 67.175.224.138 (talk) 03:37, 21 April 2018 (UTC).
 * You can look here and here. Ruslik_ Zero 08:35, 21 April 2018 (UTC)

zip
I'm on Ubuntu and I'm trying to use zip to zip up these two files: such that I end up with a zip file in /home/user/ containing: One limitation is that I'm only given the absolute path of the input files, and I would prefer to keep using the absolute input paths to keep things clean. (I'm invoking zip from a script and not from a shell)

So far I've tried two approaches: produces the following zip file, which is highly undesirable due to the excessive paths:

The second approach uses the -j flag to drop the paths: But this creates a Tarbomb unfortunately, with the zip looking like this:

What's a good solution?

I'm open to using other compression utilities as well, as long as it's able to produce a zip file. Mũeller (talk) 13:31, 21 April 2018 (UTC)
 * Just drop /home/user:


 * --Wrongfilter (talk) 14:28, 21 April 2018 (UTC)
 * Thanks for the response. Yes, that would be the solution if I'm running the command in a shell. But I'm invoking zip from another program, so unfortunately I'm forced to supply absolute paths for everything. Here's the Python that I'm invoking zip with:


 * Of course I could have Python spawn a shell, have the shell navigate to /home/user/, then invoke "zip -r result.zip target". That would work, but I'd prefer to keep the shell out of it to keep things simple. Mũeller (talk) 23:53, 21 April 2018 (UTC)
 * If you're willing to use tar then try the following:


 * --Wrongfilter (talk) 06:40, 22 April 2018 (UTC)
 * You don't need the shell to set a process's "current working directory". CWDs are a process thing managed by the OS on a per-process basis, not a shell thing. This says you can pass a CWD to Popen which I guess is equivalent to doing cd in a shell. 92.230.39.123 (talk) 06:43, 22 April 2018 (UTC)
 * Passing in the correct CWD solved the problem. Thank you very much for the help, you two. It's much appreciated. Mũeller (talk) 09:10, 22 April 2018 (UTC)
 * Similarly, if it was more convenient for the rest of the script, you could also choose to set the script's own CWD before starting the subprocess. I don't do Python, but in either Perl or C you'd do   (and, of course, check whether it succeeded). --69.159.62.113 (talk) 20:50, 22 April 2018 (UTC)