2016-09-12 26 views
2

我想用java讀取jpeg文件並將其寫入到我的帖子腳本文件中。當我打開通過Acrobat蒸餾後處理腳本文件,我得到一個錯誤:將jpeg圖像添加到帖子腳本文件

%%[ 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 
+0

與[tag:java]的連接無法迴避我,因爲您尚未發佈任何Java代碼。 – EJP

回答

1

我認爲這個問題是使用proc形式image通話。在這種形式下,proc必須產生一個字符串,而不是文件。

嘗試在proc結尾添加256 string readstring pop

我想你可能需要在DCT濾鏡獲得DCT編碼數據之前讀取並丟棄jpeg標題。

以字典形式image將接受文件作爲源。

+0

謝謝,我會試試看。圖像的字典形式是什麼樣的?我的意圖是「加載」一次圖像,因爲它可能出現在PS文件中多次。將使用字典形式是一個更好的方法? – user3991484

+0

我試圖添加:256字符串讀取字符串彈出後的過濾器和之前的形象,並表示OffendingCommand是讀取字符串,當我將它添加到圖像行後它說OffendingCommand是imageDistiller。 – user3991484

+0

錯誤仍然是一個類型檢查?有關重新使用該文件的信息,請參閱2002年12月號的[Acumen Journal](http://www.acumentraining.com/acumenjournal.html)以及第二部分和第三部分的下兩部分。 –