Results tagged “ghostscript” from WHO IS 2HEI?

 

很多与pdf相关的开源的插件(如:imagemagick ),
一般都需要ghostscript的支持,imagemagick的一些命令行的工具非常方便,但是用户往往不希望安装多个软件,
所以需要解决绿色安装的方式,通过脚本来写注册表。

具体方式如下:

首先可以先到http://www.ghostscript.com下载最新的版本。
比如gs8.61,先安装上,然后把整个安装目录复制出来。
搜索注册表,看到gs注册了两个键值,然后我们通过直接写注册表的方式来手工注册。

关键是配置gs的lib目录和字体目录。


建立vbs文件 gs_install.vbs

Set ws = WScript.CreateObject("WScript.Shell")

Dim ws, n, p, itemtype

p = "HKEY_LOCAL_MACHINE\SOFTWARE\GPL Ghostscript\8.61\GS_DLL"
itemtype = "REG_SZ"
n = "E:\2hei.net\gs\gs8.61\bin\gsdll32.dll"
ws.RegWrite p,n,itemtype

p = "HKEY_LOCAL_MACHINE\SOFTWARE\GPL Ghostscript\8.61\GS_LIB"
itemtype = "REG_SZ"
n = "E:\2hei.net\gs\gs8.61\lib;E:\2hei.net\gs\fonts;E:\2hei.net\gs\gs8.61\Resource;C:/WINDOW/fonts"
ws.RegWrite p,n,itemtype

ws.Run "cmd.exe /c cmd.bat",vbhide

说明:
cmd.bat 是你想要真正执行的脚本文件,上面的则是设置依赖的gs环境。
------------------------------------------

 

或者写reg文件

gs.reg

Windows Registry Editor Version 5.00
 
[HKEY_LOCAL_MACHINE\SOFTWARE\GPL Ghostscript\8.61]
"GS_DLL"="E:\\2hei.net\\gs\\gs8.61\\bin\\gsdll32.dll";
"GS_LIB"="E:\\2hei.net\\gs\gs8.61\\lib;E:\\t2hei.net\gs\fonts;E:\\2hei.net\\gs\\gs8.61\\Resource;C:/WINDOWS/fonts";

说明:
Windows Registry Editor Version 5.00
// - 注释 (空一行)
[路径] (注意用大小写);
"键名"="键值" (针对字符串型键值);
"键名"=hex:键值 (针对二进制型键值);
"键名"=dword:键值 (针对DWORD键值);

| | Comments (0) | TrackBacks (0)


when you want to covert postscript's file to pdf file
you can use ghostscript and gsview .

ghostscript's install.
next is gs copy the system's font to itself  .

I fond this in cidfmap ...
%!
% cidfmap generated automatically by mkcidfm.ps from fonts found in
%   C:/WINDOWS/fonts

% Substitutions
/BatangChe << /FileType /TrueType /SubfontID 1 /CSI [(Korea1) 3] /Path (C:/WINDOWS/fonts/batang.ttc) >> ;
/GungsuhChe << /FileType /TrueType /SubfontID 3 /CSI [(Korea1) 3] /Path (C:/WINDOWS/fonts/batang.ttc) >> ;
/Batang << /FileType /TrueType /SubfontID 0 /CSI [(Korea1) 3] /Path (C:/WINDOWS/fonts/batang.ttc) >> ;
/MS-Mincho << /FileType /TrueType /SubfontID 0 /CSI [(Japan1) 3] /Path (C:/WINDOWS/fonts/msmincho.ttc) >> ;
/NSimSun << /FileType /TrueType /SubfontID 1 /CSI [(GB1) 2] /Path (C:/WINDOWS/fonts/simsun.ttc) >> ;
/SimHei << /FileType /TrueType /SubfontID 0 /CSI [(GB1) 2] /Path (C:/WINDOWS/fonts/simhei.ttf) >> ;
/DotumChe << /FileType /TrueType /SubfontID 3 /CSI [(Korea1) 3] /Path (C:/WINDOWS/fonts/gulim.ttc) >> ;
/Gulim << /FileType /TrueType /SubfontID 0 /CSI [(Korea1) 3] /Path (C:/WINDOWS/fonts/gulim.ttc) >> ;
/Gungsuh << /FileType /TrueType /SubfontID 2 /CSI [(Korea1) 3] /Path (C:/WINDOWS/fonts/batang.ttc) >> ;
/MS-UI-Gothic << /FileType /TrueType /SubfontID 2 /CSI [(Japan1) 3] /Path (C:/WINDOWS/fonts/msgothic.ttc) >> ;
/MS-Gothic << /FileType /TrueType /SubfontID 0 /CSI [(Japan1) 3] /Path (C:/WINDOWS/fonts/msgothic.ttc) >> ;
/MS-PGothic << /FileType /TrueType /SubfontID 1 /CSI [(Japan1) 3] /Path (C:/WINDOWS/fonts/msgothic.ttc) >> ;
/MS-PMincho << /FileType /TrueType /SubfontID 1 /CSI [(Japan1) 3] /Path (C:/WINDOWS/fonts/msmincho.ttc) >> ;
/Dotum << /FileType /TrueType /SubfontID 2 /CSI [(Korea1) 3] /Path (C:/WINDOWS/fonts/gulim.ttc) >> ;
/GulimChe << /FileType /TrueType /SubfontID 1 /CSI [(Korea1) 3] /Path (C:/WINDOWS/fonts/gulim.ttc) >> ;
/MingLiU << /FileType /TrueType /SubfontID 0 /CSI [(CNS1) 2] /Path (C:/WINDOWS/fonts/mingliu.ttc) >> ;
/PMingLiU << /FileType /TrueType /SubfontID 1 /CSI [(CNS1) 2] /Path (C:/WINDOWS/fonts/mingliu.ttc) >> ;
/SimSun << /FileType /TrueType /SubfontID 0 /CSI [(GB1) 2] /Path (C:/WINDOWS/fonts/simsun.ttc) >> ;

% Aliases
/STFangsong-Light /SimSun ;
/HYSMyeongJo-Medium /Batang ;
/HeiseiMin-W3 /MS-Mincho ;
/STKaiti-Regular /SimHei ;
/STSong-Light /SimSun ;
/MKai-Medium /MingLiU ;
/MHei-Medium /MingLiU ;
/Ryumin-Medium /MS-Mincho ;
/HeiseiKakuGo-W5 /MS-Gothic ;
/MSung-Medium /MingLiU ;
/GothicBBB-Medium /MS-Gothic ;
/HYRGoThic-Medium /Gulim ;
/Ryumin-Light /MS-Mincho ;
/HYGoThic-Medium /Dotum ;
/STHeiti-Regular /SimHei ;
/MSung-Light /MingLiU ;

when you have gsview,you must edit the gsview32.ini


[GSview-4.9]
Version=4.9
GSversion=861
GhostscriptDLL=D:\Program Files\gs\gs8.61\bin\gsdll32.dll
GhostscriptInclude=D:\Program Files\gs\gs8.61\lib;D:\Program Files\gs\fonts;D:\Program Files\gs\gs8.61\Resource;C:/WINDOWS/fonts
GhostscriptOther=-dNOPLATFONTS -sFONTPATH="c:\psfonts"
Configured=1


sometimes you cant find the specific fonts in your country such as China's founder and huaguang.
when you open the ps file, the message is fallow.

------------------------------------------------------------
Substituting font Courier for JZDX.
Can't find (or can't open) font file D:\Program Files\gs\gs8.51\Resource/Font/JDH.
Can't find (or can't open) font file JDH.
Didn't find this font on the system!


ps-error1.jpg

 

 

 

 

 

 

 

 

 

 

 

------

 error2.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

gs need fonts in C:\windows\fonts
also   D:\Program Files\gs\gs8.51\Resource/Font

so you must put the Font JDH in the directorys.
like this : D:\Program Files\gs\gs8.51\Resource/Font/JDH.

------------------------------------------------------------
But I fond the founder and huaguang'fonts can't agree with the ghostscript.

and the CMap also haven't this fonts.

Someone say founder's fonts isn't the standard ps file.  :(
------------------------------------------------------------
I will try to find how to resolve it!!

 

| | Comments (2) | TrackBacks (0)

标签