| <<<Back 1 day (to 2017/03/23) | 20170324 |
tt | ? | 02:15.11 |
| hi | 02:15.16 |
ghostbot | Welcome to #ghostscript, the channel for Ghostscript and MuPDF. If you have a question, please ask it, don't ask to ask it. Do be prepared to wait for a reply as devs will check the logs and reply when they come on line. | 02:15.16 |
osfe | Hi there. I'm looking for a way to convert the black parts of a p[s|df] file to white and just the black parts (the file is w/b) | 08:19.37 |
| please | 08:19.40 |
kens | "<</NegativePrint true>> setpagedevice" | 08:20.36 |
| That's a device-dependent parameter. Otherwise you need to set a transfer function | 08:21.12 |
| For NegativePrint see the PostScript Language Reference Manual 3rd edition, page 415 | 08:21.53 |
| For transfer funcitons in PostScript, see the PLRM, settransfer operator, page 685. | 08:22.48 |
| Transfer funcitons in PDF are covered in section 6.3 of the 1.7 PDF Reference Manual, on page 484 | 08:23.29 |
osfe | kens: hhmm, ok | 08:27.59 |
| gs -o input.pdf -sDEVICE=pdfwrite -c "<</NegativePrint true>> setpagedevice" -f output.pdf something like that ? | 08:29.43 |
kens | You can try it | 08:29.57 |
osfe | kens: how would you write it ? | 08:31.43 |
kens | I wouldn't, I don't need to invert the output of files. | 08:32.00 |
osfe | ok | 08:33.06 |
kens | Actually, that won't work | 08:33.22 |
| PDF files can't have a page device dictionary, and pdfwrite won't apply NegativePrint. | 08:33.42 |
| So you'll need to use a transfer function. | 08:33.53 |
osfe | kens: unless I convert to ps before ? | 08:34.07 |
kens | No. | 08:34.13 |
| THe NegatiovePrint parameter is a page device parameter which is only applied at rendering. | 08:34.30 |
| Siunce pdfwrite doesn't render, it won't apply it. | 08:34.41 |
| And it can't preserve it, because PDF files can't have that parameter | 08:34.56 |
osfe | so... ? | 08:35.37 |
ghostbot | so... are we the only ones here today? seems awfully quiet... | 08:35.37 |
kens | osfe : so use a transfer function, like I said | 08:36.04 |
osfe | kens: ok | 08:36.58 |
| gs -o output.pdf -sDEVICE=pdfwrite -c "{1 exch sub}{1 exch sub}{1 exch sub}{1 exch sub} setcolortransfer" -f input.pdf something like taht | 08:37.56 |
kens | Well that's a color transfer function, I'd think you just want settransfer, since you say its a monochrome file | 08:38.40 |
osfe | gs -o voltage_input_frontend_inv.pdf -sDEVICE=pdfwrite -c "{1 exch sub} settransfer" -f voltage_input_frontend.pdf | 08:45.51 |
| it does not work | 08:45.55 |
| I need help please | 08:46.01 |
kens | I suspect the PDF interpreter does an initgraphics, which will defeat a settransfer | 08:46.25 |
| You could try setting it as part of a BeginPage procedure instead | 08:46.46 |
osfe | I'll do it with convert | 08:49.10 |
| too complicated | 08:49.14 |
| plus it's too be included in a latex document, not even sure it works | 08:49.40 |
| for f in *.pdf; do convert -density 600 -negate "$f" "${f%.pdf}_inv.pdf";done | 08:57.42 |
| works but generates larger files | 08:57.51 |
kens | Probably becasue the content is now all bitmap image | 08:58.07 |
osfe | kens: sure | 09:08.15 |
| gnuplot | 09:08.23 |
| Forward 1 day (to 2017/03/25)>>> | |