将jpeg图像添加到后脚本文件

时间:2016-09-12 18:04:52

标签: image jpeg postscript

我正在尝试用java读取jpeg文件并将其写入我的帖子脚本文件。当我用Acrobat蒸馏器打开post脚本文件时出现错误:

%%[ Error: typecheck; OffendingCommand: imageDistiller ]%%

Stack:
{(   Leaving filterIntercept
) --print-- --flush--}
false
/DCTDecode
-dict-
-file-


%%[ Flushing: rest of job (to end-of-file) will be ignored ]%%
%%[ Warning: PostScript error. No PDF file produced. ] %%

以下是我的postscript文件减去jpeg数据的内容。

%!PS-Adobe-3.0

/jpegimage
{173 36 1 [173 0 0 -36 0 36]
{currentfile /ASCII85Decode filter /DCTDecode filter}
image
} bind def

%%Page: 1 1
%%PageBoundingBox: 0 0 612.0 792.0

100 200 translate
jpegimage
...(jpeg data inline here)...
showpage
%%PageTrailer

%%Trailer
%%EOF

1 个答案:

答案 0 :(得分:1)

我认为问题是使用proc调用的image形式。在这种形式中,proc必须产生一个字符串,而不是文件。

尝试在proc结束时添加256 string readstring pop

我认为您可能需要在DCT过滤器获取DCT编码数据之前读取并丢弃jpeg标头。

在词典表格中image将接受一个文件作为来源。