Баннерная страница Custom Cups

Я хочу создать собственную баннерную страницу Кубков и до сих пор ничего не придумал, когда искал в сети, как это сделать.

В /usr/share/cups/banners есть «высокоуровневые» определения баннеров, которые, в свою очередь, относятся к файлам PDF, найденным в /usr/share/cups/data.

Кроме того, в папке данных есть файлы ODT, которые, как я полагаю, используются для создания файлов PDF. Но делается ли это с помощью встроенного генератора PDF, например, в LibreOffice или как это сделать?

Как указать в шаблоне ODT, какую переменную куда вставлять?

Можно ли указать, что для печати баннера используется отдельный лоток (с цветной бумагой), а затем принтер продолжает работу, используя любой лоток, указанный в задании?


person user3721979    schedule 13.02.2015    source источник


Ответы (1)


У нас есть собственная баннерная страница. Он в постскриптуме и содержит некоторые поля, которые заполняются при печати. Поля находятся в {}. Вот файл постскриптума, который вы можете использовать в качестве отправной точки. Это модифицированная версия какой-то ранней постскриптумной баннерной страницы CUPS.

%!PS-Adobe-3.0
%%BoundingBox: 0 0 612 792
%%Pages: 1
%%LanguageLevel: 1
%%DocumentData: Clean7Bit
%%DocumentSuppliedResources: procset bannerprint/1.0
%%DocumentNeededResources: font Helvetica Helvetica-Bold Times-Roman
%%Creator: Michael Sweet, Easy Software Products
%%CreationDate: May 10, 2000
%%ModifiedBy: Roy Costa IBM International Technical Support Organization
%%ModificationDate: March 01, 2004
%%Title: ITSO Custom cover page
%%EndComments
%%BeginProlog
%%BeginResource procset bannerprint 1.1 0
%
% PostScript banner page for the Common UNIX Printing System ("CUPS").
%
% Copyright 1993-2002 Easy Software Products
%
% These coded instructions, statements, and computer programs are the
% property of Easy Software Products and are protected by Federal
% copyright law. Distribution and use rights are outlined in the file
% "LICENSE.txt" which should have been included with this file. If this
% file is missing or damaged please contact Easy Software Products
% at:
%
% Attn: CUPS Licensing Information
% Easy Software Products
% 44141 Airport View Drive, Suite 204
% Hollywood, Maryland 20636-3111 USA
%
% Voice: (301) 373-9603
% EMail: [email protected]
% WWW: http://www.cups.org
%
/CUPSLOGO {% Draw CPPM logo
% height CUPSLOGO
% Start with a big C...
/Helvetica findfont 1 index 2 div scalefont setfont
0 setgray
0 0 moveto
(C) show
% Then "UNIX Printing System" much smaller...
/Helvetica-Bold findfont 1 index 9 div scalefont setfont
0.25 mul
dup 1.4 mul dup 0.4 mul moveto
(P.P.M.) show
} bind def
/ESPLOGO {% Draw the ESP logo
% height ESPLOGO
% Compute the size of the logo...
0 0
2 index 1.5 mul 3 index
% Do the "metallic" fill from 10% black to 40% black...
1 -0.001 0 {
dup % loopval
-0.15 mul% loopval * -0.15
28 Printing with Linux on IBM Eserver zSeries Using CUPS and Samba
0.9 add% 0.9 - loopval * 0.15
setgray% set gray shade
0 % x
1 index neg% loopval
1 add% 1 - loopval
3 index% height
mul % height * (1 - loopval)
moveto% starting point
dup % loopval
3 index% width
mul % loopval * width
2 index% height
lineto% Next point
0 % x
2 index% height
lineto% Next point
closepath
fill
dup % loopval
0.15 mul% loopval * 0.15
0.6 add% 0.6 + loopval * 0.15
setgray
dup % loopval
neg 1 add% 1 - loopval
3 index% width
mul % (1 - loopval) * width
0 % y
moveto% Starting point
2 index% width
exch% loopval
2 index% height
mul % loopval * height
lineto% Next point
1 index% width
0 % y
lineto% Next point
closepath
fill
} for
0 setgray rectstroke
/Helvetica-BoldOblique findfont 1 index 3 div scalefont setfont
dup 40 div
dup 4 mul 1 index 25 mul moveto (E) show
dup 10 mul 1 index 15 mul moveto (S) show
dup 16 mul 1 index 5 mul moveto (P) show
/Helvetica-BoldOblique findfont 2 index 5 div scalefont setfont
dup 14 mul 1 index 29 mul moveto (asy) show
dup 20 mul 1 index 19 mul moveto (oftware) show
dup 26 mul 1 index 9 mul moveto (roducts) show
pop
} bind def
%%EndResource
%%EndProlog
%%Page: 1 1
gsave
% Determine the imageable area and device resolution...
initclip newpath clippath pathbbox% Get bounding rectangle
72 div /pageTop exch def% Get top margin in inches
72 div /pageRight exch def% Get right margin in inches
72 div /pageBottom exch def% Get bottom margin in inches
72 div /pageLeft exch def% Get left margin in inches
/pageWidth pageRight pageLeft sub def% pageWidth = pageRight - pageLeft
/pageHeight pageTop pageBottom sub def% pageHeight = pageTop - pageBottom
/boxWidth % width of text box
pageWidth pageHeight lt
{ pageWidth 54 mul }
{ pageHeight 42 mul }
ifelse def
newpath % Clear bounding path
% Create fonts...
/largeFont /Helvetica findfont % largeFont = Helvetica
pageHeight 5 mul scalefont def % size = pageHeight * 3 (nominally 33)
/mediumFont /Helvetica findfont% mediumFont = Helvetica
pageHeight 1.5 mul scalefont def% size = pageHeight * 1.5 (nominally 16.5)
/bigFont /Helvetica findfont % bigFont = Helvetica
pageHeight 2 mul scalefont def % size = pageHeight * 3 (nominally 33)
% Offset page to account for lower-left margin...
pageLeft 72 mul
pageBottom 72 mul
translate
% Job information box...
largeFont setfont
pageWidth 4 mul % x = pageWidth * 1/2 * 72
pageHeight 58 mul % y = pageHeight * 1/2 * 72
pageHeight 5 mul add % y -= 1 line
2 copy % Copy X & Y
moveto
({job-originating-user-name}) show 1
bigFont setfont % Big sized font
pageWidth 4 mul % x = pageWidth * 1/2 * 72
pageHeight 58 mul % y = pageHeight * 1/2 * 72
pageHeight -5 mul add % y += 1 line
2 copy % Copy X & Y
moveto
({job-name}) show 2
pageWidth 4 mul % x = pageWidth * 1/2 * 72
pageHeight 58 mul % y = pageHeight * 1/2 * 72
pageHeight -10 mul add % y += 2 lines
2 copy % Copy X & Y
moveto
({printer-name}-{job-id}) show 3
pageWidth 4 mul % x = pageWidth * 1/2 * 72
pageHeight 58 mul % y = pageHeight * 1/2 * 72
pageHeight -15 mul add % y += 2 lines
2 copy % Copy X & Y
moveto
({time-at-creation}) show 4
% Then the CUPS logo....
gsave
pageWidth 4 mul
pageWidth 6 mul
translate
pageWidth 9 mul CUPSLOGO
grestore
% And the ESP logo....
%gsave
%pageWidth 59 mul
%pageWidth 6 mul
%translate
%pageWidth 6 mul ESPLOGO
%grestore
% Show the page...
grestore
showpage
%
% End of "$Id: standard,v 1.8 2002/01/31 14:19:37 mike Exp $".
%
%%EOF
person chmike    schedule 16.06.2015