Raw pdf color conversion (with known conversion formula) from RGB to CMYK -


this question related to

however way more specific. consider not expert in print production ;)

situation: printing allowed use 2 colors, cyan , black. printery requests final pdf in devicecmyk channels c , k used.

pdflatex automatically (with xcolor package) fonts , drawn objects, have more 100 sketches/figures in pdf format embedded in manuscript. due admittedly badly designed workflow (late realization inkscape cannot export cmyk pdfs), these figures created in inkscape, , rgb pdfs.

however, used colors within inkscape rgb complements of cmy(k), e.g. 100% cyan (0,255,255) rgb , 50% k (127,127,127) etc.

problem: need convert these pdf figures rgb devicecmyk (or alternatively whole pdf of final manuscript) specific conversion formula.

i did lot of google research , tried suggested ways of using e.g. ghostscript or various print production tools in adobe acrobat, of conversion techniques found far wanted use icc color profiles or used other conversion strategy filled channels , spared c , k, example.

i know exact conversion formula raw color numbers our inkscape-rgbs channels c , k, not know or find program or tool allows me manually specify conversion formulas.

question: there workflow convert pdfs rgb c(my)k manually own specific conversion formula raw numbers converted pdf being in devicecmyk using tool, script or adobe product?

due large number of figures prefer batched solution doesn't require coding side, if should solution, i'd open minded workflow "load/convert/save" within program every single figure or writing small program easy-to-handle c++ pdf api example.

limitations , additional info: different file format (like tikz figures) not possible more since not work , necessary adaptions figures create overhead. maybe helpful information: since figures created in inkscape, there no raster images within pdfs. not want figures converted raster images during color conversion.

edit:

i have created example of rgb pdf-figure created inkscape.
did manual object-by-object color conversion cmyk-pdf illustrator, show how result should like. illustrator stores axial shading in devicen colorspace colors cyan , black, close enough^^

here idea, think work if pdf files using exclusively colorspaces devicegray, devicergb , devicecmyk:

1- convert pdf files postscript (with pdf2ps ghostscript example)

2- write postscript program redefines operators setrgbcolor, setgray , setcolor own implementation in postscript language, implementation internally use setcmykcolor , compute values using custom formula.

here example redefining setgray operator:

% operator setcmykcolor expects 4 values in stack % when setgray called, can expect have 1 value in stack, % use black component of cmyk adding 3 zeros , rolling % top 4 elements of stack 3 times  /setgray { 0 0 0 4 3 roll setcmykcolor } bind def 

3- paste postcript program @ begining of each resulting ps file step 1.

4- convert files pdf (with ps2pdf example)

see in action saving piece of code sample.ps:

/setgray { 0 0 0 4 3 roll setcmykcolor } bind def 0.5 setgray 0 0 moveto 600 600 lineto stroke showpage 

convert pdf ghostscript using command line (i used version 9.14):

gswin64c.exe -dnopause -dbatch -sdevice=pdfwrite -soutputfile=sample.pdf sample.ps 

the resulting pdf have following page content:

q 0.1 0 0 0.1 0 0 cm /r7 gs 10 w % k operator pdf equivalent of setcmykcolor in postscript 0 0 0 0.5 k  0 0 m 3000 3000 l s q 

as can see, ps-> pdf conversion preserve cmky colors specified in postscript setcmykcolor operator.

maybe can post formula new question , out translating postscript.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -