mb
2 years ago
12 changed files with 272 additions and 25 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
@ -0,0 +1,22 @@ |
|||||
|
%! |
||||
|
/sys_setcolorspace /setcolorspace load def |
||||
|
/sys_setcolor /setcolor load def |
||||
|
userdict/is_rgb false put |
||||
|
/setcolorspace |
||||
|
{ |
||||
|
sys_setcolorspace |
||||
|
currentcolorspace 0 get /DeviceRGB eq |
||||
|
userdict/is_rgb 3 -1 roll put |
||||
|
}bind def |
||||
|
/setcolor |
||||
|
{ |
||||
|
userdict/is_rgb get not |
||||
|
{sys_setcolor} |
||||
|
{ |
||||
|
3 copy |
||||
|
2 copy eq 4 1 roll eq exch pop and |
||||
|
{setgray pop pop (!\n)print flush} |
||||
|
{/DeviceRGB sys_setcolorspace sys_setcolor}ifelse |
||||
|
}ifelse |
||||
|
}bind def |
||||
|
% |
@ -0,0 +1,25 @@ |
|||||
|
#! /bin/bash |
||||
|
|
||||
|
# CONVERTS RGB PDF TO CMYK PDF PRESERVING TRUE BLACK FOR VECTORS |
||||
|
# OVERPRINT FEATURE IS AVAILABLE WITH AN OPTION |
||||
|
|
||||
|
# USAGE: |
||||
|
# ./rgb2cmyk.sh input.pdf |
||||
|
# ./rgb2cmyk.sh input.pdf overprint |
||||
|
|
||||
|
# OUTPUT: |
||||
|
# input-cmyk.pdf |
||||
|
# input-cmyk-op.pdf (in case of overprint) |
||||
|
|
||||
|
bn=$(basename $1 ".pdf") |
||||
|
|
||||
|
gs -q -sDEVICE=pdfwrite -o ${bn}-CMYK.pdf -sColorConversionStrategy=CMYK -sSourceObjectICC=control.txt $1 |
||||
|
|
||||
|
# OVERPRINT COMMANDS BELOW |
||||
|
|
||||
|
pdftops -level2sep ${bn}-CMYK.pdf |
||||
|
sed -e "s/false \(op\)/true \1/gI" ${bn}-CMYK.ps > ${bn}-CMYK-op.ps |
||||
|
#gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=${bn}-CMYK-op.pdf ./forceblack.ps ${bn}-CMYK-op.ps |
||||
|
gs -q -sDEVICE=pdfwrite -o ${bn}-CMYK-op.pdf -sColorConversionStrategy=CMYK -sSourceObjectICC=control.txt ${bn}-CMYK-op.ps |
||||
|
#rm ${bn}-CMYK.pdf |
||||
|
rm ${bn}-CMYK.ps |
@ -0,0 +1,8 @@ |
|||||
|
# From: https://stackoverflow.com/questions/30518547/cmyk-overprinting-and-knockout-in-ghostscript |
||||
|
|
||||
|
bn=$(basename $1 ".pdf") |
||||
|
|
||||
|
gs -dBATCH -dNOPAUSE -dSAFER \ |
||||
|
-sDEVICE=tiffsep \ |
||||
|
-sOutputFile=$bn.tif \ |
||||
|
$1 |
Loading…
Reference in new issue