2011-06-05 271 views
23

如果要將ImageMagick的identify識別爲CMYK,那麼我有很多麻煩。將PDF轉換爲CMYK(具有識別CMYK的識別碼)

本質,讓我們說我建立這個文件,test.tex,與pdflatex

\documentclass[a4paper,12pt]{article} 

%% https://tex.stackexchange.com/questions/13071 
\pdfcompresslevel=0 

%% http://compgroups.net/comp.text.tex/Making-a-cmyk-PDF 
%% ln -s /usr/share/color/icc/sRGB.icm . 
% \immediate\pdfobj stream attr{/N 4} file{sRGB.icm} 
% \pdfcatalog{% 
% /OutputIntents [ << 
% /Type /OutputIntent 
% /S/GTS_PDFA1 
% /DestOutputProfile \the\pdflastobj\space 0 R 
% /OutputConditionIdentifier (sRGB IEC61966-2.1) 
% /Info(sRGB IEC61966-2.1) 
% >> ] 
% } 

%% http://latex-my.blogspot.com/2010/02/cmyk-output-for-commercial-printing.html 
%% https://tex.stackexchange.com/questions/9961 
\usepackage[cmyk]{xcolor} 

\begin{document} 
Some text here... 
\end{document} 

如果我再嘗試鑑定所得的test.pdf文件,我得到它的RGB,不管我什麼選項已經嘗試過(至少根據源代碼中的鏈接) - 但是,其中的顏色將保存爲CMYK;對於上面的源:

$ grep -ia 'cmyk\|rgb\| k' test.pdf 
0 0 0 1 k 0 0 0 1 K 
0 0 0 1 k 0 0 0 1 K 
0 0 0 1 k 0 0 0 1 K 
0 0 0 1 k 0 0 0 1 K 
FontDirectory/CMR12 known{/CMR12 findfont dup/UniqueID known{dup 
/PTEX.Fullbanner (This is pdfTeX, Version 3.1415926-1.40.11-2.2 (TeX Live 2010) kpathsea version 6.0.0) 

$ identify -verbose 'test.pdf[0]' 
... 
    Type: Palette 
    Endianess: Undefined 
    Colorspace: RGB 
    Depth: 16/8-bit 
    Channel depth: 
    red: 8-bit 
    green: 8-bit 
    blue: 8-bit 
    Channel statistics: 
    Red: 
... 
    Green: 
... 
    Blue: 
... 
    Histogram: 
     5: (12593,11565,11822) #31312D2D2E2E rgb(49,45,46) 
     4: (16448,15420,15677) #40403C3C3D3D rgb(64,60,61) 
     9: (20303,19275,19532) #4F4F4B4B4C4C rgb(79,75,76) 
     25: (23901,23130,23387) #5D5D5A5A5B5B rgb(93,90,91) 
... 

同樣幾乎發生,如果我也取消註釋\immediate\pdfobj stream ... 部分;但如果文檔中只有一種顏色(黑色),我看不到identify在哪裏出現RGB值的直方圖(儘管可以說所有這些都接近灰色)?

 

所以請不要介意這一點,那麼我雖然我還是嘗試使用ghostscripttest.pdf轉換成一個新的PDF,這將由identify被確認爲CMYK - 但沒有運氣,即使有:

$ gs -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile=test-gs.pdf -dUseCIEColor -sProcessColorModel=DeviceRGB -dProcessColorModel=/DeviceCMYK -sColorConversionStrategy=/CMYK test.pdf 

GPL Ghostscript 9.01 (2011-02-07) 
Copyright (C) 2010 Artifex Software, Inc. All rights reserved. 
This software comes with NO WARRANTY: see the file PUBLIC for details. 
Processing pages 1 through 1. 
Page 1 


$ identify -verbose 'test-gs.pdf[0]' 
... 
    Type: Grayscale 
    Base type: Grayscale 
    Endianess: Undefined 
    Colorspace: RGB 
    Depth: 16/8-bit 
... 

因此identify認爲是唯一改變的是(來自之前的Type: Palette);但除此之外它仍然會看到一個RGB色彩空間!

與此相伴,注意identify能夠正確地報告一個CMYK PDF - 見CMYK poster example: fitting pdf page size to (bitmap) image size? #17843 - TeX - LaTeX - Stack Exchange用於使用convertgs這樣一個PDF文件的命令行的例子。事實上,我們可以執行:

convert test.pdf -depth 8 -colorspace cmyk -alpha Off test-c.pdf 

...和一個PDF,這將是identify版爲CMYK這結果 - 但是,PDF也將光柵化(72 dpi的默認值)。

編輯:我剛剛發現,如果我在OpenOffice中創建.odp演示文稿,並將其導出爲PDF;該PDF將被默認RGB,但是,下面的命令(從ghostscript Examples | Production Monkeys):

# Color PDF to CMYK: 
gs -dSAFER -dBATCH -dNOPAUSE -dNOCACHE -sDEVICE=pdfwrite \ 
-sColorConversionStrategy=CMYK -dProcessColorModel=/DeviceCMYK \ 
-sOutputFile=output.pdf input.pdf 

...其實會產生CMYK PDF,報道這樣的identify(雖然,黑色將是豐富的,不平原 - 在所有四個頻道);然而,這個命令將工作只有當幻燈片添加圖像(顯然,它是一個觸發顏色轉換?!)!有趣的是,我無法從pdflatex PDF中獲得同樣的效果。

 

所以我想我的問題都可以問兩種方式:

  • 是否有在Linux的任何命令行轉換方法,將同時保留矢量的RGB PDF轉換成CMYK PDF ,它在identify中被識別爲這樣(並且因此將構建CMYK顏色的正確直方圖)
  • 是否有任何其他與identify類似的命令行Linux工具,即使在原始0中也可以正確識別CMYK顏色的使用from pdflatex並可能建立一個顏色直方圖,基於任意選擇的PDF頁面,如identify應該是)?

預先感謝任何答案,
乾杯!

 

一些參考:

回答

21

sdaau,你用於嘗試轉換PDF到CMYK是不正確的命令。試試這個來代替:

gs \ 
    -o test-cmyk.pdf \ 
    -sDEVICE=pdfwrite \ 
    -sProcessColorModel=DeviceCMYK \ 
    -sColorConversionStrategy=CMYK \ 
    -sColorConversionStrategyForImages=CMYK \ 
    test.pdf 

更新

如果顏色轉換不起作用根據需要,如果你看到一則消息像「無法色彩空間轉換爲灰色,恢復策略,以LeaveColorUnchanged」然後...

  1. 您Ghostscript的可能是從的9.x版系列較新版本,並
  2. 源PDF可能採用嵌入式ICC色彩配置文件

在這種情況下添加-dOverrideICC命令行,看看是否如期望它改變了結果。


更新2

由於@Marein評論說,如果你想避免JPEG文物出現在圖像(其中前無有),你應該添加

-dEncodeColorImages=false 

進入命令線。

(這適用於幾乎所有的GS PDF - > PDF處理,而不是僅僅針對這種情況,因爲GS默認創建與新建成的對象和新的文件結構的完全新的文件時,要求出示PDF輸出 - 它不會簡單地重新使用以前的對象,更多的「啞巴」像PDF處理器pdftk{pdftk還有其他的好處不過,別誤會我的發言!} GS默認應用JPEG壓縮。 - - 看看目前Ps2pdf documentation和搜索「ColorImageFilter」瞭解更多詳情...)

+0

用來捕獲非常感謝,@pipitas - 還沒有考出你的命令的時間,但它看起來很有道理,所以我在這裏設置的接受現在...乾杯! – sdaau 2012-02-03 08:53:02

+0

我發現使用給定的命令會將JPEG製品添加到我的圖像中。添加'-dEncodeColorImages = false'可以防止這種情況發生,同時仍然可以轉換顏色。有關非顏色變體,請參見[源代碼](http://superuser.com/questions/360216/use-ghostscript-but-tell-it-to-not-reprocess-images)。 – Marein 2015-05-28 12:25:35

+0

@Marein:感謝您的評論 - 我已將其內容包含在我的答案更新中。 – 2015-05-28 12:53:57

2

好吧,這裏是什麼東西,至少...

本來,我需要這樣的一種方式,以確保我的PDF文件是CMYK,並有文字爲「純黑色「C:0,M:0,Y:0,K:100 - 因爲之前我在打印機上遇到過問題,他們會抱怨我的Latex PDF包含文本的」豐富黑色「(因此成本更高)。我通常選擇identify,因爲它似乎是唯一可以解析PDF和顏色的工具(並且它也相對容易記住)。

好吧,我通讀了Tech Tip: Using Ghostscript to Convert and Combine Files | Linux Journal;建議使用gstiffsep設備獲取分色。對我來說,這和identify的作用相同;我可以這樣做:

$ gs -sDEVICE=tiffsep -dNOPAUSE -dBATCH -dSAFER -r150x150 -sOutputFile=p%08d.tif test.pdf 

$ ls p* 
p00000001.Black.tif p00000001.Magenta.tif p00000001.Yellow.tif p00000001.Cyan.tif p00000001.tif 

$ eog p00000001.tif 

...然後我可以只「迭代」通過使用左/右箭頭分離的圖像 - 這是,如果它是「純黑色」或「濃郁黑」立即明顯。

因此,這表明,不管是什麼identify顯示,從pdflatextest.pdf實際上有「純黑色」作爲文本顏色,因爲它應該是(其他分色是空白的) - 但是,做這樣的事情:

# do a conversion of original PDF 
$ gs -dPDFA -dBATCH -dNOPAUSE -dNOOUTERSAVE -dUseCIEColor -sProcessColorModel=DeviceCMYK -sDEVICE=pdfwrite -sOutputFile=out_pdfa.pdf test.pdf 

# do a separation on the converted pdf 
$ gs -sDEVICE=tiffsep -dNOPAUSE -dBATCH -dSAFER -r150x150 \ 
    -dFirstPage=1 -dLastPage=1 -sOutputFile=p%08d.tif out_pdfa.pdf 

# view 
$ eog p00000001.tif 

...將顯示具體的out_pdfa.pdf實際上有'豐富的黑色' - 即文字墨水經過所有四個分色! (identify也將這個顯示爲RGB)。

所以,我希望這gs/tiffsep技術比identify :)

 

注更可靠:我使用Ubuntu納蒂,其中船舶GhostScript的9.01 - 但是,一個有討厭的bug與tiffsepBug 691857 – tiffsep crashes in Version 9 (missing lab.icc)。這已被固定爲9.02 - 和9.02已發佈爲ghostscript in oneiric。要使用9.02納蒂下,我也跟着how to update a single package using apt-get? - Ubuntu Forums

sudo nano /etc/apt/sources.list # add deb http://archive.ubuntu.com/ubuntu/ oneiric main restricted 
sudo apt-get update 
sudo apt-get install ghostscript # this upgrades only gs and dependencies 
sudo nano /etc/apt/sources.list # remove/comment oneiric repo 
sudo apt-get update && sudo apt-get upgrade # should be back to normal here 

注意,與越野車9.01版本,即使該命令會失敗:

$ GS_LIB=/usr/share/ghostscript/9.01/iccprofiles/ gs -sICCProfilesDir=/usr/share/ghostscript/9.01/iccprofiles/ -sDEVICE=tiffsep -dNOPAUSE -dBATCH -dSAFER -sOutputFile=p%08d.tif out_pdfa.pdf 

... 
sfopen: gs_parse_file_name failed. 
sfopen: gs_parse_file_name failed. 
... gsicc_open_search(): Could not find lab.icc ... 

..和用9.02,沒有必要明確指定sICCProfilesDir

6

我有一個不相關的問題,但我目前也在努力處理CMYK PDF。

我這裏寫了這個小腳本(這就是所謂的pdf2pdfx):

#!/bin/bash 

gs \ 
-dPDFX \ 
-dBATCH \ 
-dNOPAUSE \ 
-dNOOUTERSAVE \ 
-sDEVICE=pdfwrite \ 
-sColorConversionStrategy=CMYK \ 
-dProcessColorModel=/DeviceCMYK \ 
-dPDFSETTINGS=/prepress \ 
-sOutputFile="${1%%.pdf}_X-3.pdf" \ 
PDFX_def.ps \ 
"$1" 

和我PDFX_def.ps包含以下(我刪除了ICC配置文件和定義FOGRA39,這應該是OK):

%! 
% $Id$ 
% This is a sample prefix file for creating a PDF/X-3 document. 
% Feel free to modify entries marked with "Customize". 

% This assumes an ICC profile to reside in the file (ISO Coated sb.icc), 
% unless the user modifies the corresponding line below. 

systemdict /ProcessColorModel known { 
    systemdict /ProcessColorModel get dup /DeviceGray ne exch /DeviceCMYK ne and 
} { 
    true 
} ifelse 
{ (ERROR: ProcessColorModel must be /DeviceGray or DeviceCMYK.)= 
    /ProcessColorModel cvx /rangecheck signalerror 
} if 

% Define entries to the document Info dictionary : 

% /ICCProfile (/usr/share/color/icc/ISOcoated_v2_300_eci.icc) def % Customize or remove. 

[ /GTS_PDFXVersion (PDF/X-3:2002) % Must be so (the standard requires). 
    /Title (Title)     % Customize. 
    /Trapped /False     % Must be so (Ghostscript doesn't provide other). 
    /DOCINFO pdfmark 

% Define an ICC profile : 

currentdict /ICCProfile known { 
    [/_objdef {icc_PDFX} /type /stream /OBJ pdfmark 
    [{icc_PDFX} <</N systemdict /ProcessColorModel get /DeviceGray eq {1} {4} ifelse >> /PUT pdfmark 
    [{icc_PDFX} ICCProfile (r) file /PUT pdfmark 
} if 

% Define the output intent dictionary : 

[/_objdef {OutputIntent_PDFX} /type /dict /OBJ pdfmark 
[{OutputIntent_PDFX} << 
    /Type /OutputIntent    % Must be so (the standard requires). 
    /S /GTS_PDFX      % Must be so (the standard requires). 
    /OutputCondition (Commercial and specialty printing) % Customize 
    /Info (none)      % Customize 
    /OutputConditionIdentifier (FOGRA39)  % Customize 
    /RegistryName (http://www.color.org) % Must be so (the standard requires). 
    currentdict /ICCProfile known { 
    /DestOutputProfile {icc_PDFX} % Must be so (see above). 
    } if 
>> /PUT pdfmark 
[{Catalog} <</OutputIntents [ {OutputIntent_PDFX} ]>> /PUT pdfmark 

確定然後正確報告CMYK顏色空間。 前:

[email protected] ~/orpheus/werbung/action $ identify -verbose action_schulungsvideo_v3_print.pdf 
Image: action_schulungsvideo_v3_print.pdf 
    Format: PDF (Portable Document Format) 
    Class: DirectClass 
    Geometry: 612x859+0+0 
    Resolution: 72x72 
    Print size: 8.5x11.9306 
    Units: Undefined 
    Type: TrueColor 
    Endianess: Undefined 
    Colorspace: RGB 
    Depth: 16/8-bit 
    Channel depth: 
    red: 8-bit 
    green: 8-bit 
    blue: 8-bit 
    Channel statistics: 
    Red: 
     min: 0 (0) 
     max: 65535 (1) 
     mean: 53873.6 (0.822058) 
     standard deviation: 19276.7 (0.294144) 
     kurtosis: 1.854 
     skewness: -1.82565 
    Green: 
     min: 0 (0) 
     max: 65535 (1) 
     mean: 55385.6 (0.84513) 
     standard deviation: 19274.6 (0.294112) 
     kurtosis: 2.09868 
     skewness: -1.91651 
    Blue: 
     min: 0 (0) 
     max: 65535 (1) 
     mean: 51020 (0.778516) 
     standard deviation: 20077.7 (0.306367) 
     kurtosis: 0.860627 
     skewness: -1.52344 
    Image statistics: 
    Overall: 
     min: 0 (0) 
     max: 65535 (1) 
     mean: 53426.4 (0.815235) 
     standard deviation: 19546.7 (0.298263) 
     kurtosis: 1.59453 
     skewness: -1.75701 
    Rendering intent: Undefined 
    Interlace: None 
    Background color: white 
    Border color: rgb(223,223,223) 
    Matte color: grey74 
    Transparent color: black 
    Compose: Over 
    Page geometry: 612x859+0+0 
    Dispose: Undefined 
    Iterations: 0 
    Compression: Undefined 
    Orientation: Undefined 
    Properties: 
    date:create: 2011-09-14T15:38:57+02:00 
    date:modify: 2011-09-14T15:38:57+02:00 
    pdf:HiResBoundingBox: 612.283x858.898+0+0 
    pdf:Version: PDF-1.5 
    signature: 210bfc9cf90e3b9505385f8b2267da1665b5c2de28bb5223311afba01718bbeb 
    Artifacts: 
    verbose: true 
    Tainted: False 
    Filesize: 1.577MBB 
    Number pixels: 526KB 
    Pixels per second: 52.57MB 
    User time: 0.020u 
    Elapsed time: 0:01.009 
    Version: ImageMagick 6.6.5-6 2011-04-08 Q16 http://www.imagemagick.org 

後:

[email protected] ~/orpheus/werbung/action $ pdf2pdfx action_schulungsvideo_v3_print.pdf 
GPL Ghostscript 9.04 (2011-08-05) 
Copyright (C) 2011 Artifex Software, Inc. All rights reserved. 
This software comes with NO WARRANTY: see the file PUBLIC for details. 
Processing pages 1 through 1. 
Page 1 


[email protected] ~/orpheus/werbung/action $ identify -verbose action_schulungsvideo_v3_print_X-3.pdf 
Image: action_schulungsvideo_v3_print_X-3.pdf 
    Format: PDF (Portable Document Format) 
    Class: DirectClass 
    Geometry: 612x859+0+0 
    Resolution: 72x72 
    Print size: 8.5x11.9306 
    Units: Undefined 
    Type: ColorSeparation 
    Base type: ColorSeparation 
    Endianess: Undefined 
    Colorspace: CMYK 
    Depth: 16/8-bit 
    Channel depth: 
    cyan: 8-bit 
    magenta: 8-bit 
    yellow: 8-bit 
    black: 8-bit 
    Channel statistics: 
    Cyan: 
     min: 0 (0) 
     max: 65535 (1) 
     mean: 8331.78 (0.127135) 
     standard deviation: 14902.2 (0.227392) 
     kurtosis: 1.62171 
     skewness: 1.7799 
    Magenta: 
     min: 0 (0) 
     max: 62194 (0.94902) 
     mean: 6739.34 (0.102836) 
     standard deviation: 14517.5 (0.221523) 
     kurtosis: 2.08183 
     skewness: 1.93276 
    Yellow: 
     min: 0 (0) 
     max: 65535 (1) 
     mean: 13310.1 (0.203098) 
     standard deviation: 17022.5 (0.259746) 
     kurtosis: 0.991135 
     skewness: 1.45216 
    Black: 
     min: 0 (0) 
     max: 56540 (0.862745) 
     mean: 7117.47 (0.108606) 
     standard deviation: 16803.7 (0.256408) 
     kurtosis: 3.02752 
     skewness: 2.16554 
    Image statistics: 
    Overall: 
     min: 0 (0) 
     max: 65535 (1) 
     mean: 8874.66 (0.135419) 
     standard deviation: 15850.6 (0.241864) 
     kurtosis: 2.17614 
     skewness: 1.88139 
    Total ink density: 292% 
    Rendering intent: Undefined 
    Interlace: None 
    Background color: white 
    Border color: cmyk(223,223,223,0) 
    Matte color: grey74 
    Transparent color: black 
    Compose: Over 
    Page geometry: 612x859+0+0 
    Dispose: Undefined 
    Iterations: 0 
    Compression: Undefined 
    Orientation: Undefined 
    Properties: 
    date:create: 2011-09-14T15:39:30+02:00 
    date:modify: 2011-09-14T15:39:30+02:00 
    pdf:HiResBoundingBox: 612.28x858.9+0+0 
    pdf:Version: PDF-1.3 
    signature: 0416db7487ea147b974ece5748bc4284e82bfc3fb7cd07a4de050421ba112076 
    Artifacts: 
    verbose: true 
    Tainted: False 
    Filesize: 2.103MBB 
    Number pixels: 526KB 
    Pixels per second: 5.25708PB 
    User time: 0.000u 
    Elapsed time: 0:01.000 
    Version: ImageMagick 6.6.5-6 2011-04-08 Q16 http://www.imagemagick.org 

這是與GS 9.04 也許這可以幫助64位的Gentoo?

Source PDF源自inkscape pdf導出,顏色僅限於ECI ISO coated v2中涵蓋的顏色。 我用這個作爲Inkscape中的缺乏CMYK出口的解決方法和缺乏印前準備PDF/X輸出...

+0

非常感謝這個詳細的回答與範例,@tbart - 希望能夠在早點看的問題再次出現:)乾杯! – sdaau 2011-09-19 19:23:33

+2

當心,Ghostscript的9.05真是狠毒並嘗試打開'在/ usr /共享/的ghostscript/9.05/lib中/ PDFX_def.ps'在Ubuntu 12.04 – 2013-09-24 20:23:25

+0

將它們轉換爲CMYK時,這種方法保存的載體,還是需要進行光柵化第一? – johnp 2016-09-09 08:37:17

1

我也被這個驅動瘋狂。我試過@ tbart的例子,但它只適用於某些輸入的pdf(看起來已經包含圖像,rgb或不是),而不是其他的。具體來說,讓我們這個超級簡單的PS文件:

%!PS 
/Times-Roman findfont 30 scalefont setfont 
72 680 moveto 
0.81 0.72 0 0 setcmykcolor 
(This is text!) show 
showpage 

如果我把這稱爲test1.ps,然後運行該命令(在Windows上,GS 9.14):

gswin64c -dEmbedAllFonts=true -dPDFX -dBATCH -dNOPAUSE -dNOOUTERSAVE -sDEVICE=pdfwrite -dProcessColorModel=/DeviceCMYK -sOutputICCProfile=CoatedGRACoL2006.icc -sColorConversionStrategy=CMYK -sColorConversionStrategyForImages=CMYK -sOutputFile=test1.pdf PDFX_def.ps test1.ps 

與GS如果更換gswin64c你在linux/cygwin上。

我使用的CMYK ICC是在PDFX_def.ps和在上面的命令。你可以從這裏得到它,但它只是一個隨機的ICC,moo想要它們的卡片,它看起來並不特殊:http://www.adobe.com/support/downloads/thankyou.jsp?ftpID=4075&fileID=3790

從此加載的test1.pdf作爲CMYK pdf在Illustrator中,但標識 - 詳細地說它是sRGB。如果我做@ sdaau的tiffsep事情,它會寫出分隔符,並且它們有正確的值。

所以,我不知道。

任何人都可以得到這個PS文件轉換爲標識識別CMYK PDF?

克里斯


編輯:哇。我可能已經弄明白了並修正了它。它看起來像識別只是在PDF文件中尋找/ ColorSpace/DeviceCMYK,所以如果我篡改PDFX_def.ps輸出它,識別將稱之爲CMYK。因此,通過查看有效的pdf文件,我發現如果他們有這一行識別工作,如果沒有,他們被錯誤地標記爲sRGB。

在PDFX_def.ps結束時,添加/ ColorSpace中/ DeviceCMYK行:

[/_objdef {OutputIntent_PDFX} /type /dict /OBJ pdfmark 
[{OutputIntent_PDFX} << 
    /ColorSpace /DeviceCMYK   % convince ImageMagick's identify that it's CMYK 
    /Type /OutputIntent    % Must be so (the standard requires). 
    /S /GTS_PDFX      % Must be so (the standard requires). 
    /OutputCondition (Commercial and specialty printing) % Customize 
    /Info (none)      % Customize 
    /OutputConditionIdentifier (CGATS TR 003)  % Customize 
    /RegistryName (http://www.color.org) % Must be so (the standard requires). 
    currentdict /ICCProfile known { 
    /DestOutputProfile {icc_PDFX} % Must be so (see above). 
    } if 
>> /PUT pdfmark 
[{Catalog} <</OutputIntents [ {OutputIntent_PDFX} ]>> /PUT pdfmark 

動臂。我希望這不會做任何奇怪的兼容性或任何事情。

+1

不幸的是,當我這樣做時,我的PDF變得柵格化。有沒有辦法避免這種情況? – 2014-12-02 20:37:39

+0

謝謝你,@ChrisHecker - 我還沒有測試過,但很高興能寫下這些......乾杯! – sdaau 2015-05-09 01:40:39

+1

@PedroMDuarte:(1)'identify'是ImageMagick的一部分。 (2)ImageMagick無法自行處理PDF輸入(它只能直接處理光柵圖像) - 它會將Ghostscript用作所有PDF輸入的*'委託'*,甚至可以識別PDF。 (3)當ImageMagick獲得PDF輸入時,它會首先調用Ghostscript將其轉換爲(一系列)整頁光柵圖像,然後繼續對其進行處理。 (4)您無法直接控制ImageMagick用於運行Ghostscript的確切命令(它可能會將CMYK輸入重新轉換爲RGB廣告)。 – 2016-09-09 09:17:50

1

再次重溫與PDF/X-3的CMYK轉換爲我在隊列中的另一打印作業卻讓我發現了以下工作:

如果你只需要CMYK,避免X-3。 它不支持透明度(https://en.wikipedia.org/wiki/PDF/X)和青色有色圖像,你會得到既不是令人滿意的,也不它實際上將符合任何標準。如果您有alpha,不透明度,如果您的印刷廠不需要,漸變不會轉換爲PDF/X-3。

如果你確實需要的PDF/X,你需要光柵化和去X-3。有沒有X-4上,我知道在「衆所周知的工具鏈」的Linux /免費軟件產品(ImageMagick的,Inkscape中,GIMP等)

不過,我仍然戰鬥定義濃郁黑,F .EX。 60%C,60%M,40%Y,100%K - 這裏是一個相當典型的印刷廠標準。每當我設置在Inkscape中也將盡快消失的出口(以RGB;開羅限制)

不過,這是什麼,似乎讓我接近他們所期望的:

#!/bin/bash 

# possibly ps2ps2 for keeping fonts? 
pdf2ps -sOutputFile=- "$1" | gs \ 
-dPDFX \ 
-dBATCH \ 
-dNOPAUSE \ 
-dNOOUTERSAVE \ 
-dPDFSETTINGS=/prepress \ 
-dCompatibilityLevel=1.4 \ 
-sDEVICE=pdfwrite \ 
-sColorConversionStrategy=CMYK \ 
-sProcessColorModel=DeviceCMYK \ 
-dHaveTransparency=false \ 
-sOutputFile="${1%%.pdf}_X-3.pdf" \ 
PDFX_def.ps \ 
- 

CMYK-PDF輸出工作流程的真正CMYK創建見解仍然非常受歡迎。 Scribus並不是真正的解決方案,因爲它有很多問題正確地導入inkscape SVG。除此之外,scribus在創建CMYK-PDFs方面做得不錯。