2010-09-30 74 views
2

我對Ghostscript有點問題。我正在使用Ghostscript API gs32dll.dll在.NET中編寫應用程序。它適用於很多pdf,但是有一些有這部小電影可以讓人興奮,ghostscript會拋出一個關於沒有該字體的錯誤。我知道我必須在cidfmap文件中爲該字體列出一個列表,但由於我沒有使用實際的ghostscript安裝,因此我沒有指向該文件的本地路徑。我想要將這個程序安裝在多臺計算機上,但我寧願不在這些計算機上安裝完整的ghostscript。所以,我想知道是否可以將cidfmap的副本放入dll中。我想它可能會首先看到它的路徑。我甚至會用ghostscript跳過這個角色的轉換來變得很酷。我願意接受任何想法。使用api的Ghostscript字體

關於該程序:
我教數學。我們有關於pdf的這些筆記指南。每章中的每個部分都有兩個pdf,一個沒有答案,一個沒有答案。我使用ghostscript將pdf轉換爲圖像(jpegs)。一旦完成,用戶將能夠使用智能手寫板突出顯示答案的區域,答案將從答案文檔圖像中剪切下來並粘貼在空白文檔的相同位置。我計劃在完成之後將其發給其他數學老師。我想保持程序自包含,所以我不必向他們解釋如何安裝ghostscript和whatnot。我只想給他們一個文件夾。

Revision = 900

RevisionDate = 20100914

Product = GPL Ghostscript

Copyright = Copyright (C) 2010 Artifex Software, Inc. All rights reserved.

GPL Ghostscript 9.00 (2010-09-14)

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 5.

Page 1

Page 2

Can't find CID font "ZapfDingbats".

Substituting CID font /Adobe-Identity for /ZapfDingbats, see doc/Use.htm#CIDFont

Substitution.

The substitute CID font "Adobe-Identity" is not provided either. Will exit with error.

Error: /undefined in findresource

Operand stack:

--dict:11/20(L)-- G27 1 --dict:5/5(L)-- --dict:5/5(L)-- ZapfDingbat s-Identity-H --dict:10/12(ro)(G)-- --nostringval-- CIDFontObject --dict: 7/7(L)-- --dict:7/7(L)-- Adobe-Identity Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval- - 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- fa lse 1 %stopped_push 1910 1 3 %oparray_pop 1909 1 3 %oparray_ pop 1893 1 3 %oparray_pop --nostringval-- --nostringval-- 3 1 5 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- false 1 %stopped_push --nostringval-- %loop_continue --nostringval-- --nos tringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval -- %array_continue --nostringval-- --nostringval-- --nostringval-- --n ostringval-- --nostringval-- %loop_continue Dictionary stack: --dict:1158/1684(ro)(G)-- --dict:1/20(G)-- --dict:82/200(L)-- --dict:82 /200(L)-- --dict:108/127(ro)(G)-- --dict:293/300(ro)(G)-- --dict:23/30(L)- - --dict:6/8(L)-- --dict:22/40(L)-- --dict:14/15(L)--

Current allocation mode is local

Last OS error: No such file or directory

GPL Ghostscript 9.00: Unrecoverable error, exit code 1

回答

0

如何分離您的程序在客戶端和服務器部分?

然後服務器可以安裝所有的Ghostscript和所有類型的字體,訪問該服務器的客戶端根本不需要Ghostscript。

也可以根據您的具體情況幫助解決授權問題。

在回答編輯的問題:

也許你可以本地程序drectory內安裝Ghostscript的便攜式文件夾:

看這個forum comment尋找靈感。我知道別人也成功了。

+0

我加了一點關於該程序。我希望程序自成一體,因此我可以將該程序的文件夾交給其他教師。我寧願他們不必安裝任何東西。這就是爲什麼我使用API​​而不是直接調用程序。 – 2010-09-30 12:34:57

1

在Linux commanline,調用

gs -h 

在Windows上,調用

gswin32c.exe -h 

這將顯示你的Ghostscript的情況下使用的搜索路徑(S)。這可能會幫助您確定您的文件夾結構中您需要放置字體資源的位置。

您還可以使用額外的CLI參數覆蓋任何內置的搜索路徑:

gswin32c.exe^
    -I"d:/absolute/path/to/dir;../relative/path/to/dir;c:/other dir with spaces"^
    [...] 

需要注意的是在Windows Ghostscript的是能夠使用正斜槓作爲目錄分隔符的路徑。

我確定你可以以某種方式將這種調用(-I...)添加到你的軟件中。