EBS 打印机设置——PASTA

按照Oracle的说法,PASTA解决的是通过CM直接打印到打印机的问题。换句话说如果不想通过CM直接打印到打印机,可以不使用PASTA;这个和PS中文输出没有关系。

确实如此,从执行过程看,我觉得完全可以这样理解:PASTA是操作系统lp命令的扩展!

PASTA的可执行程序是FNDPSTAX,具体参数请看PASTA User Guide 3.0(目前最高版本)。这里提供一个例子:
FNDPSTAX -fSCFTEST.ps -o1.ps -np
或者FNDPSTAX -fSCFTEST.txt -o1.ps -np

或者FNDPSTAX -fSCFTEST.pdf -o1.ps -np

这3个例子也是PASTA目前支持的文件类型
-f是输入文件名
-o是输出文件名
-np是说不用打印
-F是配置文件,这里没用,默认是pasta.cfg

注意,和上面的IX虽然用的是同一个配置文件,但不要搞混淆了。PASTA也有IX
Printing功能,到底是用6i的还是自己的就无所谓了。
前面讲过,FNDPSTAX本身不用IX_PRINTING环境变量。

实际上PASTA的功能是把CM输出的.out文件,按照pasta.cfg(实际上可能用其他文件)的指示做格式文件转换,然后调用操作系统打印命令打印到打印机。操作系统打
印由配置文件指定,如:
% for UNIX platform
printCommand=lp -c -d{printername}
% for Windows platform
ntPrintCommand=print /D:{printername}

PASTA格式转换说明
打印机不认PDF文件,所以在调用操作系统打印命令之前需要转换格式,PASTA就是处理这种情况的解决方案之一。
从目前看,PASTA支持下面几种格式的输入文件:PDF,PS,ASCII。

当然PASTA是自动检测文件类型的,和文件扩展名没有关系,实际CM传给FNDPSTAX的都是.out文件。
转换逻辑

PS文件:不转,直接送给打印机
ASCII:看配置文件的outputFormat参数,该参数默认是ps,所以会转成PS格式,这个时候就要用配置文件里面指定的字体了;转换完毕,再送给打印机。注意这里的PS
文件和我们请求的PS输出是两码事!

PDF:PASTA本身没有能力处理,需要送给其他外部程序处理,这个由preprocess参数决定,如:
% You can get a list of output devices available in Ghostscript
% at:
% http://www.gnu.org/software/ghostscript/devices.html
; preprocess=gs -q -dNOPAUSE -dBATCH -sDEVICE=pxlmono -sOutputFile={outfile}
{infile}
……
; preprocess=ps2pdf {infile} {outfile}

转换完毕,再送给打印机。
这里的结果文件是临时文件,用完默认就删除了,不影响我们的.out文件。
我在Windows平台用的是Xpdf,测试OK。

PASTA配置文件说明:
直接看pasta.cfg文件的说明即可。这里提一下重点:[DEFAULT]区域的Font.Default.Plain和Font.Default.Bold 设的是默认字体。

语言区域如[AMERICAN]或者[SIMPLIFIED CHINESE](当然可以设置在一起用逗号隔开,还可以设置Territory)设置的是根据用户当前NLS_LANG做判断选择的字体。
字体ADUOSC.ttf(普通)和ADUOSCB.ttf(粗体)支持中文。所以有人干脆把它作为[DEFAULT]设置以解决中文问题,这个不是地道的做法。

PASTA打印机设置说明
看系统管理员文档即可。很简单,向系统注册支持Postscript的操作系统打印机(名字
要一样),类型选择--PASTA Universal Printer Type;当然也可以参照这个自定义
了。

PASTA配置文件:

路径:$FND_TOP/$APPLRSC/pasta.cfg

/* $Header: pasta.cfg 120.0 2005/05/07 16:44:37 appldev noship $ */

%%
%% pasta.cfg -- Pasta configuration file
%%
% Hisory
%
% Initial - Copied frommmm pasta.cfg in Pasta 2.5.1
%           Removed multiple font support, which only works for IX Library. ——只有IX Libary支持多种字体
%

% This is the main Pasta configuration file.
%
% If this is the first time you have modified this file, please read the
% notes at the end of this file first.
%
%%%% ================= Overview ======================================= %%%%
% Pasta is a product that is part of the E-Business Suite's Application
% Object Library (FND). It is provided as an executable named FNDPSTAX
% and enables you to print a text report that contains any characters
% from any language.
%
% You can use the same configuration file for both Pasta and IX 
% Library, or you can use separate ones.
%
% Any line that starts with a % (percent) or a ; (semi-colon) is a
% comment and is ignored. In this sample file we are using a % for
% commentary and a ; for options that you may want to enable.——以%开头的是解释,以 ;开头的是可能设置的选项
%
% Any variable that starts with a < (less-than) and ends with a >
% (greater-than) in fontpath, boldfontpath, errorlogfile and outfile
% parameters will be transalted into an environment variable. You can
% specify any environment variable. Pasta will replace the environment
% variable with the actual value at runtime.
%
% You can use either a / (slash) or a \ (backslash) as the delimiter in
% a file path, regardless of the platform. Pasta will use an
% appropriate delimiter automatically according to platform.
%
% The configuration options are grouped into sections. A section
% starts with a [ (left square bracket) and ends with a ] (right square
% bracket). Section names are case insensitive. The [DEFAULT] section
% is mandatory. The language and territory sections are optional. If you
% want to override the options in the [DEFAULT] section according to
% languages and territories, you can add multiple language and territory
% sections. Each language section is specified by [{NLS_LANGUAGE}] where
% {NLS_LANGUAGE} is the Oracle language name. Each territory section is
% specified by [_{NLS_TERRITORY}] where {NLS_TERRITORY} is Oracle
% territory name. Also, you can specify both {NLS_LANGUAGE} and
% {NLS_TERRITORY} at the same time as [{NLS_LANGUAGE}_{NLS_TERRITORY}].
% One section name can contain multiple languages and/or territories
% separated by commas.
%
%% The following notes apply only to Pasta, not to the IX Library.
%
% If you have multiple printers registered and you need a specific setup
% for each printer, it is very easy to have a specific configuration file
% for each printer. This is an example for supporting a PCL printer.
%
%  1. Copy $FND_TOP/resource/pasta.cfg to
%     $FND_TOP/resource/pasta_<yourprinter>.cfg where <yourprinter>
%     will be the printer name you define on the operating system and
%     in the E-Business Suite (both should be the same name).
%
%  2. Edit the configuration file to meet your requirement.
%     For example, if you need to print in PCL then uncomment the
%     preprocess option for PCL printing and make necessary changes
%     for the parameters of Ghostscript if needed.
%     Regarding Ghostscript, please refer to http://www.ghostscipt.com.
%
%  3. PASTA will try to read $FND_TOP/resource/pasta_<yourprinter>.cfg
%     first and if the file is not found then will try to read
%     $FND_TOP/resource/pasta.cfg.
%
% The default name of the configuration file is "pasta.cfg". You can
% override it by using the '-F' (configuration file) command line option.
% For example, if you specify "-Fpcl.cfg" in the command line, Pasta
% will search for the file named "pcl_<your printer>.cfg" first and then
% search for "pcl.cfg".
%
% Parameters indicated as "IX Library compatible" work for IX Library too.
% All options affect to character mode reports.
%
% Please note that most of the options will not affect to pass through
% mode such a case that input file format is PostScript or PDF printing.
% The option that will take affect are: 
% printCommand, printCommandOption, ntPrintCommandOption and preprocess

%%%% ================= Default settings ============================ %%%%
%% The options in this default section can be overridden by the options
%% in the language and territory sections below.

[DEFAULT]

        %% ============== Output Format ============================ %%
        % Output Format [ps|text.<charset|auto>]
        %
        % Currently, Pasta supports two output formats: Postscript and
        % text. If you have a Postscript Level 2 (or higher) printer,
        % please set this option to "ps". If the input is a text file,
        % Pasta will convert it to a Postscript file. If the input is
        % already a Postscript file, Pasta will send it to a printer as
        % is. Whether a file is Text or PS is automatically sensed on
        % input.
        %
        % If you don't have a Postscript printer and want to send a
        % text file to your printer, please set this option to "text".
        % You can specify the output character set by the Oracle
        % character set name (e.g. text.WE8ISO8859P1). You can use
        % "auto" as the output character set (e.g. text.auto). In that
        % case, Pasta will convert the data from the original character
        % set to an appropriate one according to the NLS_LANGUAGE setting.
        %
        % In the case of text output, only the thai_space_compensation
        % and preprocess options are effective. Other options are ignored.
        %
        % If you set this option to "text" and want to send printer-
        % specific escape sequences to your printer with text, you
        % must keep the escape sequence settings in "Initialization"
        % and "Reset" in the printer driver.
        outputFormat=ps

        %% ============== Preprocessing Command ==================== %%
        % Pasta can use a preprocessing command to invoke any executable
        % that supports an input file and an output file (a filter program).
        % You can use redirection. Pasta will invoke the filter program
        % to preprocess the Pasta output before passing it to the printing
        % command. By using the preprocess option, you can generate output
        % formats other than the formats Pasta currently supports. For
        % example, you can generate PCL output.

        % You can use {infile} and {outfile} in this option.
        % {infile} is the output file generated by Pasta. You can use
        % it as input for the preprocessing command. It is a temporary
        % file and will be deleted after being passed to the
        % preprocessing command. {outfile} is the output file generated
        % by the preprocessing command. Pasta names it temporarily and
        % it will be deleted after being passed to the printing command.
        % If you want to keep it, you can name it by using the '-o'
        % command line option. Pasta will copy {outfile} to the file you
        % specify.

        % Preprocess for PCL printing
        % This is an example for PCL printing. In this example, "gs" is
        % Ghostscript and "pxlmono" is a device used with HP black and
        % white PCL XL printers (LaserJet 5 and 6 family).
        % Ghostscript is a tool that can convert a Postscript file to
        % a PCL file.
        % You can get the latest version of Ghostscript at:
        % www.ghostscript.com.
        %
        % You can get a list of output devices available in Ghostscript
        % at:
        % http://www.gnu.org/software/ghostscript/devices.html
        ; preprocess=gs -q -dNOPAUSE -dBATCH -sDEVICE=pxlmono -sOutputFile={outfile} {infile}

        % Preprocess for PDF output
        % This is an example for PDF output. ps2pdf is a shell script
        % bundled with Ghostscript. ps2pdf can convert a Postscript
        % file to a PDF file. In most cases, you cannot send a PDF
        % file to the printer command because the printer command
        % cannot understand PDF. Set the noPrint option to "y" or use
        % the '-np' (no print) command line option if you do not want
        % to have Pasta send the PDF file to a printer. Use the outFile
        % option or the '-o' (output file name) command line option to
        % store the output file wherever you like. You can use {inputfile}
        % in the outFile option. Pasta will replace it with the actual
        % input file name (without the path) specified by the '-f'
        % (input file) command line option.
        ; preprocess=ps2pdf {infile} {outfile}
        ; noPrint=y
        ; outFile=<APPLTMP>/{inputfile}.pdf

        %% ============== Paper Size (in inches) =================== %%
        % You can specify the paper (page) size in inches. Pagewidth
        % specifies width and pageheight specifies height. If you want
        % to use a different paper size for a particular language or
        % territory, please override this value in the language and/or
        % territory sections.

        % [A4]
        pagewidth=8.27
        pageheight=11.69

        % [Letter]
        % If you want to use Letter as the default paper size, comment
        % the A4 settings above and uncomment the following lines:
        ; pagewidth=8.5
        ; pageheight=11

        %% ============== Space Size  ============================== %%
        % You can increase the space between characters by increasing
        % the value of widthScaleRate and between lines by increasing
        % the value of heightScaleRate.
        widthScaleRate=1.0
        heightScaleRate=1.0 

        %% ============== Margins (in inches) ====================== %%
        % These settings should be changed to suitable values for your
        % printer.
        topMargin=0.25
        leftMargin=0.25
        rightMargin=0.25
        bottomMargin=0.25

        %% ============== Tab Size (in spaces) ===================== %%
        % Pasta replaces a tab with a specified number of spaces. You
        % can alter the number of spaces using this option.
        tabsize=8

        %% ============== Font Size (in points) ==================== %%
        % This value affects all of the fonts you use in your reports.
        % You can specify any number (e.g. 10.5).
        fontsize=9

        %% ============== Font Name ================================ %%
        % You can use any TrueType fonts on your middle tier server.
        % If you specify a TrueType font, Pasta will subset and embed
        % the font in the Postscript output file and send it to your
        % Postscript printer. Your printer does not need to have any
        % fonts installed. Oracle provides Andale fonts (ADUO*.ttf)
        % for printing. Also, if your printer has a font installed that
        % is suitable for the language of your report, you can utilize
        % the printer font.
        %
        % The form of this option is:
        % Font.<Face>.<Style>=<TrueType font file name>
        % or
        % Font.<Face>.<Style>=printer:<Printer font name>
        %
        % The <Face> must be either "Default" for Pasta.
        %
        % The <Style> must be either "Plain" or "Bold".
        % 
        % Font options are IX Library compatible.
        Font.Default.Plain=<FND_TOP>/<APPLRSC>/ADUO.ttf
        Font.Default.Bold=<FND_TOP>/<APPLRSC>/ADUOB.ttf

        % Uncomment the following if you want to use printer fonts as a
        % default. All printers have the Courier font installed by default.
        % Courier has glyphs for Western European characters. 
        ; Font.Default.Plain        = printer:Courier
        ; Font.Default.Bold         = printer:Courier-Bold

        %% ============== Printing Command ========================= %%
        % You can specify the printing command and options you want
        % to use to print your report. Pasta will pass the final output
        % to this command. {printername} will be replaced by the
        % actual printer name passed through the command line option
        % (-pn), so in most cases you don't have to change these
        % options.

        % for UNIX platform
        printCommand=lp -c -d{printername}

        % for Windows platform
        ntPrintCommand=print /D:{printername}

        %% ============== Printing Options ========================= %%
%
        % Embed number of copies [y|n]
        %
        % You can embed the number of copies to be printed in a
        % Postscript file. However, some other printers do not support
        % the command. In that case, please set this option to "n".
        % Pasta will send the report multiple times up to the number of
        % copies. By embedding the number of copies, you can eliminate
        % the header page normally printed between reports.
        embednumcopies=y

        % Collate [y|n]
        %
        % If you set "embednumcopies" to "y" above, you can choose to
        % have the copies collated (e.g. 123123) or uncollated
        % (e.g. 112233) by setting the "copysort" option. If you set
        % "embednumcopies" to "n", the order is always 123123.
        % For example, if you want to print two copies of a report
        % that has 3 pages, the output will be:
        %
        %            | embednumcopies
        %            | y         n
        % ------------------------------
        % copysort y | H123123   H123H123
        % copysort n | H112233   H123H123
        %
        % where "H" stands for a header and "123" stands for 1st page,
        % 2nd page and 3rd page.
        copysort=y

        % Duplex printing [y|n|default]
        %
        % You can specify duplex or not. "default" means that it depends
        % on the printer-side setting.
        duplex=default

        %% ============== BiDi Specific Options ==================== %%
        % The following options work only for Bi-Directionallanguages
        % such as Arabic or Hebrew.

        % Global direction [ltr|rtl|default]
        %
        % ltr: Left-To-Right
        % rtl: Right-To-Left
        % default: It depends on NLS_LANGUAGE. If NLS_LANGUAGE is
        %          Arabic or Hebrew, it is rtl. Otherwise, it is ltr.
%
        % <IX Library compatible>
        direction=default

        % Do string layout [y|n]
        % <IX Library compatible>
        dolayout=y

        % Do Arabic shaping [y|n]
        % <IX Library compatible>
        doshaping=y

        % numerals [arabic|hindi|context]
        %
        % arabic: To always use Arabic numerals
        % hindi: To always use Hindi numerals
        % context: To use Arabic or Hindi depending on the context
        % <IX Library compatible>
        numerals=context

        % Bidi layouting algorithm [oracle|unicode]
        % 
        % If you set this option to "unicode", Pasta follows the
        % Unicode BiDi algorithm. For information about the Unicode BiDi
        % algorithm, please refer to the following site.
        % http://www.unicode.org/unicode/reports/tr9/index.html
        %
        % For backward compatibility, Pasta still supports Oracle's
        % original algorithm. If you want to use it, please set
        % this option to "oracle".
        % <IX Library compatible>
        bidi_algorithm=unicode

        %% ============== Thai Specific Options ==================== %%
        % Space compensation for Thai [y|n]
        %
        % In the Thai language, some characters are combined into one
        % glyph. If thai_space_compensation is set to "y", Pasta will
        % align your report by adding spaces at the end of any string
        % that includes combined characters. This option works only for
        % Thai characters. Pasta can automatically detect Thai characters,
        % so it is safe to set this option to "y" for languages other
        % than Thai. However, it may affect performance because Pasta
        % checks whether space compensation is necessary or not for all
        % characters. In this configuration file, this option is set to
        % "y" only in the Thai section below, which overrides the setting
        % here.
        thai_space_compensation=n

        %% ============== Error Log File =========================== %%
        % This tells Pasta to create a log file. The default error
        % output is stderr.
        ;errorlogfile=pasta.log

%%%% ================= Language Specific Settings ================== %%%%
%%%% Each language section is specified by [{NLS_LANGUAGE}] where
%%%% {NLS_LANGUAGE} is the Oracle language name.
%%%% One section name can contain multiple languages separated by 
%%%% commas.

%% For Western European (Latin-1) languages
[AMERICAN,CATALAN,GERMAN,DANISH,SPANISH,LATIN AMERICAN SPANISH,FRENCH,CANADIAN FRENCH,ENGLISH,ITALIAN,ICELANDIC,NORWEGIAN,DUTCH,PORTUGUESE,BRAZILIAN PORTUGUESE,SWEDISH,FINNISH]

        Font.Default.Plain        = printer:Courier
        Font.Default.Bold         = printer:Courier-Bold

%% For Simplified Chinese
[SIMPLIFIED CHINESE]

        Font.Default.Plain=<FND_TOP>/<APPLRSC>/ADUOSC.ttf
        Font.Default.Bold=<FND_TOP>/<APPLRSC>/ADUOSCB.ttf

%% For Traditional Chinese
[TRADITIONAL CHINESE]

        Font.Default.Plain=<FND_TOP>/<APPLRSC>/ADUOTC.ttf
        Font.Default.Bold=<FND_TOP>/<APPLRSC>/ADUOTCB.ttf

%% For Japanese
[JAPANESE]

        Font.Default.Plain=<FND_TOP>/<APPLRSC>/ADUOJ.ttf
        Font.Default.Bold=<FND_TOP>/<APPLRSC>/ADUOJB.ttf

%% For Korean
[KOREAN]

        Font.Default.Plain=<FND_TOP>/<APPLRSC>/ADUOK.ttf
        Font.Default.Bold=<FND_TOP>/<APPLRSC>/ADUOKB.ttf

%% For Thai
[THAI]

        thai_space_compensation=y

        % If you need text output for Thai, please uncomment the 
        % following line.
        ; outputFormat=text.TH8TISASCII

%%%% ================= Territory Specific Settings ================= %%%%
%%%% Each territory section is specified by [_{NLS_TERRITORY}] where
%%%% {NLS_TERRITORY} is the Oracle territory name.
%%%% One section name can contain multiple territories separated by 
%%%% commas.

%% For America and Canada regions
[_AMERICA,_CANADA]

        % [Letter]
        pagewidth=8.5
        pageheight=11

时间: 2024-10-22 07:59:03

EBS 打印机设置——PASTA的相关文章

NET环境下有关打印页面设置、打印机设置、打印预览对话框的实现(二)

打印|对话框|页面 前篇说了.NET环境下有关打印页面设置.打印机设置.打印预览对话框的实现,现在到了我们应用它们的时候了. 我们需要做下面的一些事情: 1.将上篇中写的程序输出类型改为类库并编译成PrinterPageSetting.dll; 2.建立C#或VB.net项目,并在项目的引用处添加引用,在弹出的对话框的.NET标签中浏览并选择PrinterPageSetting.dll: 3.在默认窗口Form1上增加一个TextBox文本框控件,默认名TextBox1(实际项目中建议采用命名及

共享打印机提示“无法保存打印机设置操作无法完成

故障现象:在设置网络打印机共享时,出现"无法保存打印机设置,操作无法完成"信息. 来宾帐户已经开启,密码为空. 网络属性里的"文件和打印机共享"和"TCP/IP协议"也都反复安装了打印服务"print spooler"服务已经启动. 查看任务管理器,"spoolsv.exe"文件已经运行反复设置反复重启. 故障依旧分析:故障到底是出现在打印机驱动程序安装上还是系统共享服务上?打印机不能设置共享,那文件夹能不

win7系统无法保存打印机设置怎么办

解决win7打印机共享 出现"无法保存打印机设置,操作无法完成(错误0x000006d9) 方法/步骤 打开windows firewall服务即可 右键计算机--管理 电脑常识 服务和应用程序 服务(或win+R,输入services回车) 找到windows firewall服务,启用即可

Win7共享打印机出现&quot;无法保存打印机设置,操作无法完成

Windows7中在共享打印机时,出现错误提示:无法保存打印机设置 操作无法完成(错误 0x000006d9) 我的解决方法是在控制面板中开启防火墙就可以.设置完之后可以把防火墙关闭. 同时运行Services.msc必须确保以下服务全部启动:Computer browser.Server.Print spooler. 微软官方文档的解释 当您尝试共享打印机的计算机上正在运行 Windows 7 或 Windows Server 2008 R2 的 0x000006D9 错误 症状 当您尝试共享

win7打印提示“无法保存打印机设置”怎么解决

  打印机是办公室的必用设备,在日常使用中都会出现一些小问题,例如打印机提示"无法保存打印机设置(错误0x000006d9)"那是怎么额回事呢?一般出现这样的问题都是因为windows firewall服务未开启的原因,那么知道原因后我们就要去开启. 1.右键点击我的电脑 选择管理 2.在弹出的界面中选择右边的"服务和应用出现" 打开 3,弹出界面中选着"服务"打开找到windows firewall服务,将它启动类型改为"启用&quo

打印机设置16开纸张

一.16开是多大 16开:大度(国际尺寸):210mm×285mm .正度(国内尺寸):185mm×260mm 16k纸有如下尺寸: 16k(184mm×260mm) .16k(195mm×270mm) .16k(197mm×273mm) .16k(210mm×297mm) 即A4纸 二.打印机设置16开纸张 步骤一.点击电脑左下角的[开始]选项中的[设置],然后选择[打印机与传真],在弹出打印机的文件夹中,在空白处单击鼠标右键,选择[服务器属性]. 步骤二.在弹出属性窗口中,点击上面的[格式]

Windows 7系统共享打印机出现“无法保存打印机设置操作无法完成 错误0x00000d9”

  故障现象: Windows 7系统共享打印机出现"无法保存打印机设置操作无法完成 错误0x00000d9". 原因分析: 此问题是因为防火墙windows firewall服务未开启导致. 解决方案: 开启windows firewall服务 方法一 1. 鼠标右键点击我的电脑,选择管理并打开管理; 2. 打开左侧的服务和应用程序,双击击右侧的服务并打开; 3. 在出现的服务列表中找到 windows firewall 选择启用即可. 方法二 1. 控制面板下找到防火墙; 2. 使

Win7共享打印机出现“无法保存打印机设置操作无法完成 错误0x00000d9”

  Windows 7系统共享打印机出现"无法保存打印机设置操作无法完成 错误0x00000d9". 此问题是因为防火墙windows firewall服务未开启导致. 解决方案: 开启windows firewall服务 方法一 1. 鼠标右键点击我的电脑,选择管理并打开管理; 2. 打开左侧的服务和应用程序,双击击右侧的服务并打开; 3. 在出现的服务列表中找到 windows firewall 选择启用即可. 方法二 1. 控制面板下找到防火墙; 2. 使用推荐设置或启用防火墙.

打印机无法保存打印机设置 操作无法完成的解决办法

  在此以win7系统为基础讲解一下,在共享打印机的时候出现"无法保存打印机设置.操作无法完成(错误0x000006d9) "的解决方法. 1.右键单击'计算机' ,在出现的菜单中选择'管理 ',进入计算机管理 对话框. 2.在计算机管理对话框中,按照路径:服务和应用程序→服务 ,在服务列表中找到'Windows Firewall'服务 ,看看此服务的'启动类型' 是否为'禁用' .如果是'禁用',右键单击此服务 ,选择'属性' 命令. 3.在windows firewall服务的属性