如何在负解码后重新导入CMYK PDF到Adobe(Illustrator / Photshop等)[0 1]

时间:2015-05-21 10:30:40

标签: pdf adobe ghostscript postscript cmyk

我有一个由InDesign创建的pdf,我想在postscript中重新创建。

以下脚本使用负解码数组按预期创建我的(简单)pdf。在pdf阅读器中看起来很棒(正如预期的那样)但是,当我在Illustrator或其他Adobe产品中重新打开它时,JPG变为负片。

  << /PageSize [419.528 595.276] >> setpagedevice 
    % [ W x H ] 
    /DeviceCMYK setcolorspace 
    % Page 1 

    %
    % Set the Original to be the top left
    %
    0 595.276 translate 
    1 -1 scale 
    gsave 


    %% Images when flipped to draw correctly are scaled UPWARDS 
%% so you need to move the x,y position to the bottom left

-1.44 621.714330709 translate % Bottom Left Cordinates

% unset the mirror or the image will be flipped!
1 -1 scale 

% scale the image
438.000944882 657.119055118 scale  %%% Need to work out size and width into Units


/Image1File (cmyk_image.jpg) (r) file /DCTDecode filter  def

/Image1
{
<<
  /ImageType 1
  /Width 1825
  /Height 2738
  /ImageMatrix [1825 0 0 -2738 0 2738]
  /BitsPerComponent 8
  /Decode [1 0 1 0 1 0 1 0] % can either be 1 0 or 0 1
  /DataSource Image1File
>>
} bind def

/DeviceCMYK setcolorspace
Image1 image

% Reset to previous X and Y ( line 13 )
grestore 
gsave

showpage 

据我所知,这是因为Adobe提供了反转其解码值的方法,但我还没有遇到一个实际的解决方案,外部库可以创建一个可以在Adobe中重复使用的pdf porgrams。

附件是有问题的JPG。

cmyk_image

执行上述script.ps的命令

gs -o output.pdf -sDEVICE=pdfwrite -dCompatibilityLevel=1.3 -dPDFSETTINGS=/prepress input.ps

CMYK image and Issue PDF.zip

2 个答案:

答案 0 :(得分:2)

我完全同意David提出的观点,特别是你不能将Illustrator用作一般的PDF编辑应用程序。

但是,因为这个一个编程问题......以下是我在上面的评论中修改过的代码。这使用过程数据源在读取数据时将其反转。这样就不需要一个'不寻常'的Decode数组,我认为这意味着它可以与Illustrator一起使用(我没有副本,因此无法检查)。

  << /PageSize [419.528 595.276] >> setpagedevice 
    % [ W x H ] 
    /DeviceCMYK setcolorspace 
    % Page 1 

    %
    % Set the Original to be the top left
    %
    0 595.276 translate 
    1 -1 scale 
    gsave 


    %% Images when flipped to draw correctly are scaled UPWARDS 
%% so you need to move the x,y position to the bottom left

-1.44 621.714330709 translate % Bottom Left Cordinates

% unset the mirror or the image will be flipped!
1 -1 scale 

% scale the image
438.000944882 657.119055118 scale  %%% Need to work out size and width into Units


/Image1File (d:/temp/cmyk_image.jpg) (r) file /DCTDecode filter  def

/Image1
{
<<
  /ImageType 1
  /Width 1825
  /Height 2738
  /ImageMatrix [1825 0 0 -2738 0 2738]
  /BitsPerComponent 8
  /ColorTransform 1
%  /Decode [1 0 1 0 1 0 1 0] % can either be 1 0 or 0 1
  /Decode [0 1 0 1 0 1 0 1] % can either be 1 0 or 0 1
%  /DataSource Image1File
  /DataSource {
Image1File 1825 string readstring pop
0 1 1824 {
1 index exch
dup 2 index exch get 255 exch sub put
} for
}
>>
} bind def

/DeviceCMYK setcolorspace
Image1 image

% Reset to previous X and Y ( line 13 )
grestore 
gsave

showpage 

答案 1 :(得分:1)

很难对你的问题给出确切的答案,但无论如何我都会尝试。简而言之,我会投票认为这是针对Adobe Illustrator的错误而记录的,这是您问题的唯一可能答案。

我打开了你的PDF文件,它看起来绝对完美,没有任何问题。 Apple Preview,Adobe Acrobat DC,Adobe Photoshop CC 2014全部正确打开并正确显示图像。我发现行为不正确的唯一应用程序是Adobe Illustrator(我测试了最新的CC 2014版本,因此我们可以假设它是所有版本的Illustrator)。

事实上,您甚至可以争论这是Illustrator中的错误还是根本不支持的错误。 Illustrator - 与流行的看法相反 - 不是 PDF编辑器,也不支持PDF规范的完整性。 Illustrator使用的文件格式也不是PDF;充其量它是PDF的一个子集,所有事实都被告知Illustrator扮演一个非常肮脏的技巧来确保往返并确保它始终能够使用它导出的PDF文件。

所以:

  • 我不相信你的声明&#34;或其他Adobe应用程序&#34;是真的还是真的(例如,旧版本的Photoshop完全有可能出现同样的问题)。
  • 我不相信您的PDF文件有问题; Illustrator出现了问题(并且您相信可以使用Illustrator打开任何随机的PDF文件而不会降级: - ))。