%!PS % A Simple Book Cover Layout Utility % ================================== % by Don Lancaster % Copyright c 2006 by Don Lancaster & Synergetics, Box 809, Thatcher, AZ, 85552 % (928) 428-4073 Email: don@tinaja.com Website: http://www.tinaja.com % Consulting services available http://www.tinaja.com/info01.html % All commercial rights and all electronic media rights ~fully~ reserved. % Linking usually welcome. Reposting expressly forbidden. Version 1.1 % An example of using my Gonzo Utilities to do a simple book cover layout % with independent front, rear, and spine areas. % ========= % This file requires the previous download of gonzo.psl % available from https://www.tinaja.com/pssamp1.shtml % Make sure the following line agrees with your own gonzo.psl location (C:/Users/don/Desktop/gonzo/gonzo.psl) run % use internal gonzo % ========== % NOTE THAT ALL PS FILENAME STRINGS !!!DEMAND!!! DOUBLE REVERSE SLASHES. % To use this program, you modify your values and save it as an ordinary ASCII % textfile. That file is then sent to Acrobat Distiller for coversion to a .PDF % file format. % IMPORTANT NOTE: Most book covers will be LARGER than a default 8-1/2 x 11 sheet % size and will DEMAND a printer with a larger size capability. You will want % to create a new DEFAULT SETTINGS selection in Distiller in which you have % changed your DEFAULT PAGE SIZE width and height to appropriate settings. % We will use an example here that will print on a standard 8-1/2 x 11 sheet size % including cropping margins. We will further use a 10x layout grid for convenience. % Layout will appear vertical in a normal screen display. Click on ROTATE VIEW % in your Acrobat Reader to view the cover normally. % Photos and images are easily included, but this makes the demo more complicated. % In general, any PostScript code can be inserted anywhere with a (\\header\\item) % run. The insertion code MUST be available on the host computer doing the % distilling. The full pathname MUST be used. Alternately, photos and images can % be directly included in the layout code at the cost of longer filelengths. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%% Low Level Book Cover Creator Service Procs %%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Setcropcolor finds a color that is the complement to the selected % background cover color. /setcropcolor {backgroundcolor {1 sub abs} forall setrgbcolor} store % /colorthebackground puts down a color rectangle of the primary % book background color. /colorbackground {gsave backgroundcolor aload pop setrgbcolor % set the background color xoffset yoffset % draw color background untrimheightmargin 2 mul trimmedcoverheight add untrimwidthmargin 2 mul trimmedcoverwidth 2 mul add spinewidth add rectfill grestore} store % /noautorotate stops Distiller from second guessing rotations. /noautorotate { /currentdistillerparams where {pop} % keep printer happy {userdict /currentdistillerparams {1 dict} put} ifelse /setdistillerparams where {pop} {userdict /setdistillerparams {pop} put} ifelse <> setdistillerparams % turn off Distiller rotation } store % /barcode is a temporary place marker for a real barcode. The actual barcode can % be inserted inline here. Or else a (\\headers\\barcode) run can be used instead. % One free source of a PostScript bar code generator is % http://www.terryburton.co.uk/barcodewriter/ % An online barcode generator and checker is found at % http://www.raise-the-bar.co.uk/cgi-bin/webbarcodegen.pl /barcode {save /bcsnap exch store % fake barcode - replace with real 1 1 1 setrgbcolor % white background 0 0 13.5 4 rectfill 0 0 0 setrgbcolor % add fake stripes 0.3 setlinewidth [{1.2 0.5 mt 3 u} 1 12] xrpt bcsnap restore} store % /sneakyborder arc crowding is detailed in PostScript Secrets #45 /sneakyborder {/sbh exch store % save sizes /sbw exch store /ra4 {rad arcto 4{pop} repeat} store 0 sbh 2 div mt % initial positioning 0 sbh zz sbh ra4 % build up pattern zz sbh zz sbh zz sub ra4 zz sbh zz sub 0 sbh zz sub ra4 0 sbh zz sub 0 sbh ra4 0 sbh zz sbh ra4 sbw sbh sbw sbh zz sub ra4 sbw sbh zz sub sbw zz sub sbh zz sub ra4 sbw zz sub sbh zz sub sbw zz sub sbh ra4 sbw zz sub sbh sbw sbh ra4 sbw sbh sbw 0 ra4 sbw 0 sbw zz sub 0 ra4 sbw zz sub 0 sbw zz sub zz ra4 sbw zz sub zz sbw zz ra4 sbw zz sbw 0 ra4 sbw 0 0 0 ra4 0 0 0 zz ra4 0 zz zz zz ra4 zz zz zz 0 ra4 zz 0 0 0 ra4 0 0 0 sbh ra4 closepath gsave 0.7 1 1 setrgbcolor fill grestore % fill background fancystrokes % fancy stroke } store /fancystrokes { 0 setlinecap 1 setlinejoin gsave 0 0 1 setrgbcolor 0.5 setlinewidth stroke grestore gsave 0.7 1 1 setrgbcolor 0.25 setlinewidth stroke grestore 0 0 1 setrgbcolor 0.06 setlinewidth stroke } store % Convenience operators... /inches {72 mul} store % inches to points converter %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%% Front, Spine, and Rear Layout Procs %%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%% % FRONT COVER % %%%%%%%%%%%%%%%%%% /makefrontcover {save /fcov exch store % take snapshot xoffset untrimheightmargin add % position on sheet trimmedcoverheight add yoffset untrimwidthmargin add trimmedcoverwidth add spinewidth add translate 90 rotate 0 0 10 setgrid % set 10x layout grid showfrontgrid { % find grid size trimmedcoverwidth 10 div floor cvi trimmedcoverheight 10 div floor cvi showgrid} if % and optionally show /fcen trimmedcoverwidth % find center for convenience 20 div store frontart1 % do the second artwork as subproc fronttitle % do the title as a subproc frontauthor % do the author as a subproc frontart2 % do the first artwork as subproc frontblurb % do the blurb as a subproc grestore % get off grid! fcov restore % and return to page } store % Front cover subprocs. Note that these can be placed in this program or else % can be run from other procs, as in (\\usualheaders\\fancyart.psl) run /fronttitle { /cstretch 0.05 store % adjust typography to grid /sstretch 0.05 store /kern 0.1 store /font0 /StoneSans-Bold % set title font [2.9 0 0 3.4 0 0] gonzofont /titlecolor [0 0 1] store % and color /yinc 3.8 store % and spacing titlecolor aload pop setrgbcolor font0 fcen 33 (INSIDE\nOUTER SP|k|kA|kCE) cc % note kerning } store /frontauthor { /cstretch 0.05 store % adjust typography to grid /sstretch 0.05 store /kern 0.1 store /font0 /StoneSans-Bold % set title font 1.7 gonzofont /authorcolor [0 0 1] store % and color /yinc 2 store % and spacing authorcolor aload pop setrgbcolor font0 fcen 22.5 (by\nMyles Long) cc % two line title with \n } store /frontblurb { /cstretch 0.05 store % adjust typography to grid /sstretch 0.05 store /kern 0.1 store /font0 /StoneSans-Bold % set title font [1.2 0 0 1.5 0 0 ] gonzofont /blurbcolor [1 0 0.7] store % and color /yinc 1.65 store % and spacing blurbcolor aload pop setrgbcolor font0 fcen 11.5 % note keystone line stretch (AT LONG LAST! The truth as revealed by sources close to an|j|j associate|j|j of|j|j the|j|j barber of a reliable spokesperson!) cc } store /frontart1 {gsave % sneaky border scheme /rad 1.99 store % sets pattern /zz 2.0 store % sets box size 2.5 26 translate % sets lower edge 24 12.3 sneakyborder % width - height - border grestore } store /frontart2 {gsave 3 4.8 23 9 1.2 roundbox % a rounded box behind the burb 0.55 1 1 setrgbcolor fill grestore } store %%%%%%%%%%%%%%%%%% % SPINE % %%%%%%%%%%%%%%%%%% /makespine {save /ssnap exch store % take snapshot xoffset untrimheightmargin add % position on sheet trimmedcoverheight add yoffset untrimwidthmargin add trimmedcoverwidth add translate 90 rotate 0 0 10 setgrid % set 10x layout grid showfrontgrid { % find grid size spinewidth 10 div floor cvi trimmedcoverheight 10 div floor cvi showgrid} if % and optionally show /scen spinewidth % find center for convenience 20 div store spinemark % do spine trademark as a subproc spinetitle % do spine title as a subproc spineauthor % do spine author as a subproc spineisbn % do spine isbm as a subproc grestore % get off grid! ssnap restore % and return to page } store % Spine cover subprocs. /spinetitle { gsave 1.7 20.5 translate -90 rotate /cstretch 0.05 store % adjust typography to grid /sstretch 0.05 store /kern 0.1 store /font0 /StoneSans-Bold % set title font [2.0 0 0 2.6 0 0] gonzofont /titlecolor [0 0 1] store % and color /yinc 3.8 store % and spacing titlecolor aload pop setrgbcolor 0 0 (INSIDE OUTER SP|k|kAC|kE) cc grestore } store /spinemark { gsave /cstretch 0.05 store % adjust typography to grid /sstretch 0.05 store /kern 0.1 store /titlecolor [0.55 0.25 0] store % and color /yinc 3.8 store % and spacing (not used) titlecolor aload pop setrgbcolor /font0 /Revue 2.2 gonzofont % set font for trademark font0 scen 1.2 (S|kP) cc grestore } store /spineauthor { gsave 2.3 37.3 translate -90 rotate /cstretch 0.05 store % adjust typography to grid /sstretch 0.05 store /kern 0.1 store /font0 /StoneSans-Bold % set title font [1.2 0 0 1.5 0 0] gonzofont /titlecolor [0 0 1] store % and color /yinc 3.8 store % and spacing titlecolor aload pop setrgbcolor 0 0 (Myles Long|k'|k|ks) cc grestore } store /spineisbn { gsave 2.8 6.3 translate -90 rotate /cstretch 0.05 store % adjust typography to grid /sstretch 0.05 store /kern 0.1 store /font0 /StoneSans-Bold % set title font [0.7 0 0 1.0 0 0] gonzofont /titlecolor [0 0 1] store % and color /yinc 1.1 store % and spacing titlecolor aload pop setrgbcolor 0 0 (1-882193\n-66-7) cc grestore } store %%%%%%%%%%%%%%%%%% % REAR COVER % %%%%%%%%%%%%%%%%%% /makerearcover {save /rsnap exch store % take snapshot xoffset untrimheightmargin add % position on sheet trimmedcoverheight add yoffset untrimwidthmargin add translate 90 rotate 0 0 10 setgrid % set 10x layout grid showfrontgrid { % find grid size trimmedcoverwidth 10 div floor cvi trimmedcoverheight 10 div floor cvi showgrid} if % and optionally show /rcen trimmedcoverwidth % find center for convenience 20 div store rearart1 % art early if underlay! rearauthor % do spine about author as a subproc rearblurb % do spine blurb as a subproc rearisbn % do spine isbn as a subproc rearbarcode % do spine barcvode as a subproc rearpress % do press name/address as subproc rearart2 % additional rear art as subproc grestore % get off grid! rsnap restore % and return to page } store %% /rearblurb { /cstretch 0.05 store % adjust typography to grid /sstretch 0.05 store /kern 0.1 store /font0 /StoneSans-Bold % set title font [1 0 0 1.2 0 0 ] gonzofont /blurbcolor [1 0 0.7] store % and color /yinc 1.55 store % and spacing blurbcolor aload pop setrgbcolor font0 rcen 22.5 % note keystone line stretch (Winner of the prestigious Gila Bend Literary Society alternate 3rd runner |j|jup |j|jaward |j|jfor |j|jthe |j|jbest |j|jbook with an aqua cover for the week of September 14, 2005.) cc } store %% /rearauthor { /cstretch 0.05 store % adjust typography to grid /sstretch 0.05 store /kern 0.1 store /font0 /StoneSans-Bold % set title font [1.0 0 0 1.2 0 0 ] gonzofont /font1 /StoneSans-Bold 0.8 gonzofont /blurbcolor [0 0 1] store % and color /yinc 1.7 store % and spacing blurbcolor aload pop setrgbcolor font0 rcen 32.5 % note keystone line stretch (ABOUT THE AUTHOR |h |1Myles Long writes books.) cc } store %% /rearisbn { /cstretch 0.05 store % adjust typography to grid /sstretch 0.05 store /kern 0.1 store /font0 /StoneSans-Bold % set title font [0.8 0 0 1.0 0 0 ] gonzofont /blurbcolor [0 0 0] store % and color /yinc 2 store % and spacing not used blurbcolor aload pop setrgbcolor font0 2 1.5 % left justify (ISBN: 1-882193-66-7) cl 2 2.7 ($23.95) cl % optionally add price } store %% /rearart1 {gsave 5.5 28 17 6 0.8 roundbox 0.5 1 1 setrgbcolor fill grestore gsave 5.5 28 17 6 0.8 roundbox clip newpath 0 3.8 mt 5 pu 18 pr 5 pd closepath 0 1 1 setrgbcolor fill grestore grestore} store % /rearpress has the name and address of the publisher /rearpress { /cstretch 0.05 store % adjust typography to grid /sstretch 0.05 store /kern 0.1 store /font0 /Revue % set logo [1.0 0 0 1.2 0 0 ] gonzofont /font1 /StoneSans-Bold 0.8 gonzofont /blurbcolor [0 0 1] store % and color /yinc 1.0 store % and spacing 0.55 0.25 0 setrgbcolor font0 rcen 10.8 (|0SYNERGETICS PRESS |1|/setblack 3860 West First Street Box 809 Thatcher, AZ 85552 http://www.tinaja.com (928) 428-4073) cc } store /setblack {0 0 0 setrgbcolor} store % color change for above % At present, a fake barcode is used. Replace it with a real one named /barcode % This can be placed inline here or a (\\headers\\barcode) run command can be used. % One free source of a PostScript bar code generator is % http://www.terryburton.co.uk/barcodewriter/ % An online barcode generator and checker is found at % http://www.raise-the-bar.co.uk/cgi-bin/webbarcodegen.pl /rearbarcode {gsave 13.7 0.8 translate % position barcode on rear barcode % image the barcode grestore} store /rearart2 {} store % optional art or image, internal or external %%%%%%%%%%%%%%%%%%% % REGIONS & CROPS % %%%%%%%%%%%%%%%%%%% % /makeregions is a convenience operator that shows you the edges % of the front, rear, and spine areas /makeregions {gsave setcropcolor % make sure color is legible! xoffset untrimheightmargin add yoffset untrimwidthmargin add translate 0 0 mt trimmedcoverheight pr trimmedcoverwidth 2 mul spinewidth add pu trimmedcoverheight pl closepath line1 stroke 0 trimmedcoverwidth mt trimmedcoverheight r 0 trimmedcoverwidth spinewidth add mt trimmedcoverheight r grestore } store % /makecrops optionally shows the folding and cutting edge areas. /makecrops {gsave setcropcolor /yt untrimwidthmargin store % convenience operators /xt untrimheightmargin store xoffset xt add % upper left crop yoffset mt yt u xt l xoffset xt add % rear top spine fold yoffset trimmedcoverwidth add yt add mt xt l xoffset xt add % front top spine fold yoffset trimmedcoverwidth add spinewidth add yt add mt xt l xoffset xt add % upper right crop yoffset trimmedcoverwidth 2 mul add spinewidth add yt add yt add mt yt d xt l xoffset xt add trimmedcoverheight add % lower left crop yoffset mt yt u xt r xoffset xt add trimmedcoverheight add % rear top spine fold yoffset trimmedcoverwidth add yt add mt xt r xoffset xt add trimmedcoverheight add % rear top spine fold yoffset trimmedcoverwidth add spinewidth add yt add mt xt r xoffset xt add trimmedcoverheight add % lower right crop yoffset trimmedcoverwidth 2 mul add spinewidth add yt add yt add mt yt d xt r grestore} store %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%% High Level Book Cover Creator Utility %%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /makeabookcover { noautorotate % stop distiller from rotations setcropcolor % create complimentary crop color colorbackground % color the active area makefrontcover % create the front cover makespine % create the spine makerearcover % create the back cover showregions { % optionally add region marks makeregions } if showcropmarks { % optionally add crop marks makecrops } if } store %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%% Demo - remove or alter before reuse %%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % enter desired data values here /backgroundcolor [ 0.8 1 1 ] store % background color [ red green blue ] 0-1 % black=0 aqua shown /showcropmarks true store % show crop marks? /showregions true store % outline cover and spine areas? /xoffset 0.5 inches store % x distance from page left to untrim /yoffset 0.5 inches store % y distance from page top to untrim /untrimwidthmargin 0.25 inches store % x distance of color bleed beyond trim /untrimheightmargin 0.75 inches store % y distance of color bleed beyond trim /trimmedcoverwidth 4 inches store % width of trimmed cover /trimmedcoverheight 6 inches store % height of trimmed cover /spinewidth 0.75 inches store % width of spine /showfrontgrid true store % show the 10x layout grids? /showspinegrid true store /showbackgrid true store % 300 400 translate 0.15 dup scale % debugging tool - leave commented makeabookcover % this actually does it showpage % EOF