42
www.front–runner.com FrameMaker Transparency in PDFs Tutorial

FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

www.front–runner.com

FrameMakerTransparency in PDFs

Tutorial

Page 2: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

2017/04/17

Copyright © 2017 AG Information Systems Ltd. (referred to herein as GEO F/X). This documentation cannot be reproduced in full or in part by any means without the prior written consent of GEO F/X.GEO F/X provides this documentation as is without warranty of any kind, express or implied, including but not limited to implied warranties of appropriateness for specific purposes or merchantability. In no event or under any circumstances shall GEO F/X or its suppliers or distributors be liable for any damages whatsoever, including and without limitation, damages resulting from business loss, which may arise from the use or inability to use this documentation, even if GEO F/X, its suppliers or distributors have been previously advised of the possibility of such damages. Since some states do not allow the exclusion or limitation of liability for consequential or incidental damages, the above limitation may not apply to you.

AG Information Systems Ltd.

GEO F/X Division

Arnis Gubins

Adobe Community ProfessionalFrameMaker

[email protected]

Page 3: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

i

Table of Contents

Creating transparency in PDFs with FrameMaker

How to create a transparent coloured background text frame that overlays an image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

What is required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2How to do this . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Edit joboptions file(s) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2Setting up transparency in FrameMaker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

pdfmark codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5/SetTransparency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5How to use pdfmarks in FrameMaker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

How this works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10Enhanced example with a border . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11Try it out . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11Adding the text to the transparent frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12

Tips to make this easier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12Making the postscript code text disappear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16Postscript Text Frames: A better way . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17

Turning on/off . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17Re-using postscript code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18

Using EPS files as an alternative way . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19

Additional background fills and transparency effects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21Linear (axial) gradient effect (Type 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21

Examples of effects due to varying coordinates . . . . . . . . . . . . . . . . . . . . . . . . . .23Examples of effects due to varying exponent . . . . . . . . . . . . . . . . . . . . . . . . . . . .24Examples using two colours . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25

Radial gradient effect (Type 3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26Examples of effects varying Extend properties . . . . . . . . . . . . . . . . . . . . . . . . . . .27Examples of effects varying exponent N . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28

Transparent images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29JPG image example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30An easier way: EPS format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32

Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

Blend mode in transparency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

Page 4: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

ii

Page 5: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

AG Information Systems Ltd. - GEO F/X Division

Creating transparency in PDFs with FrameMaker

This tutorial shows you how to create transparency effects in PDFs gener-ated from FrameMaker. The steps described can be automated with script-ing (either Extendscript or Framescript) to make the whole process easier. The scripting approach also would make it possible to easily allow trans-parency of images and to more easily utilize further effects such as gradi-ents and the various colour-blending modes available.

Are you interested in how to create effects like these?

FM Transparency?Lorem ipsum do pland sit amet, con sectetur a dip sching elit. I ped diam non nu my e plusmode tempor in cidunt ut labore et dolore. Oh magna alip quam erat volu pat. Ut dernime ad minim veniam, quis no strud exercit libration ullamcorper suscipit lab oris nisi ut aliquip ex ea commodo consequat.Duis autem vel eum irure dolor in reprehendert in voluptate velit esse molestaie consequat, vel illum dolore eu fugiat nulla pariatur. At vero eos et accusam et iusto odio blandit praesent luptatum delenit aigue duos dolor et molestias exceptur sint dupic non

Page 6: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

2 Creating transparency in PDFs with FrameMaker

How to create a transparent coloured background text frame that overlays an image

As FrameMaker uses a postscript imaging model and postscript itself doesn’t support transparency, the transparency has to be added at the PDF creation stage by Distiller using the SetTransparency pdfmark operator.

To insert pdfmark operators into FrameMaker, one must either use a PostScript text frame or import an EPS file containing the appropriate pdfmark codes.

What is required

You will need to work with the following items:

• Distiller joboptions/settings file(s) used in your PDF workflow

• Text editor to create custom PS or EPS files with various effects.

How to do this

Edit joboptions file(s) You’ll first need to let Distiller know that it’s going to have to allow trans-parency to be created. Postscript, after all, is built on an opaque colour model, so by default Distiller has the transparency control turned off. So now you have to turn it back on.

FM Transparency?Lorem ipsum do pland sit amet, con sectetur a dip sching elit. I ped diam non nu my e plusmode tempor in cidunt ut labore et dolore. Oh magna alip quam erat volu pat. Ut dernime ad minim veniam, quis no strud exercit libration ullamcorper suscipit lab oris

Page 7: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

Creating transparency in PDFs with FrameMaker 3

1. Start Distiller and select the joboptions/settings file that you typi-cally use to create your PDFs.

2. Then from the menu, select Settings > Edit Adobe PDF settings...

3. If you do not have the full Acrobat installed, then in FrameMaker, select Print > Printer: Setup button> Properties button > Adobe PDF Settings tab: Default Settings. Select the joboptions file that is typically used for creating your PDF. Then click on the Edit... button.

Note: You need to be using a Distiller version of 7.0 or greater to actually render the transparency effects.

4. Check the Compatibility settings. They should be at least Acrobat 5.0 (PDF 1.4).

Page 8: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

4 Creating transparency in PDFs with FrameMaker

5. Now click on SaveAs and save this as a file called Transparency.joboptions in the default location presented to you.

The file should now be saved in your local settings folder, typically located here:C:\Users\<user>\AppData\Roaming\Adobe\Adobe PDF\Settings

6. Open the Transparency.joboptions file using a text editor or FrameMaker in text mode (File > Open, select the file and then hold down the shift key when clicking on the Open button).

7. Change the value of the /AllowTransparency parameter to true.

8. Save the file (if using FM as the editor, use SaveAs and select the Text Only... format).

Note: To those with more knowledge of PDF creation (perhaps you’ve taken one of Shlomo Perets/Microtype excellent courses), you may be wondering

Page 9: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

Creating transparency in PDFs with FrameMaker 5

why not just include your own call to distllerparams, as the joboptions file runs before any of your own code, i.e.<< /CompatibilityLevel 1.4

/AllowTransparency true>> setdistillerparamsUnfortunately, starting with Acrobat 8, the ability to change global Distiller parameters was removed, but not properly documented.

Setting up transparency in FrameMaker

Now that Distiller is allowed to create transparent objects, let’s see how to create a transparent object.

pdfmark codes PDF supports more functionality than postscript does, but derives much of its core from postscript. So, there exists a pdfmark operator to allow you to insert PDF-specific commands in your postscript stream.

The syntax of the operator looks like this:

[ key0 value0 key1 value1 .... /keyword pdfmark

The “[ ... pdfmark” delimits the value pairs and operation defined by the keyword for postscript.

/SetTransparency One of the keyword operators is /SetTransparency. This operator sets the transparency (actually the opacity) used by stroke and fill operators to draw objects. The opacity value ranges from 0 (completely transparent) to 1 (completely opaque).

The keys and values available for this operator are:

Table 1: Graphics state parameters for transparency

Key Value Meaning

AIS Boolean

The alpha source flag (“alpha is shape”), specify-ing whether the current soft mask and alpha con-stant are to be interpreted as shape values (true) or opacity values (false). Default is false

BMname or array of

names

Current blend mode. There are 16 different modes available. See the Appendix for exam-ples.The default is Normal, if not specified.

Page 10: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

6 Creating transparency in PDFs with FrameMaker

Note: The pdfmark operator, keys and values are case-sensitive.

The key most relevant to simple background transparency is /ca (for fill-ing shapes).

The /CA key affects the outlines of any drawn lines and shapes, but is not important in FrameMaker (though interesting affects can be achieved).

The /BM (blend mode) key specifies how the colours between the back-ground and foreground blend in the transparency effect. If you want to experiment with different effects, see Blend mode in transparency on page 36 for the key values along with examples.

To set a 50% transparency to a filled object, the required pdfmark code would be:

[ /ca 0.5 /SetTransparency pdfmark

How to use pdfmarks in FrameMaker

In order for this command in FrameMaker to have any effect, it must be interpreted as postscript commands. This means that you need to use either a PostScript Text frame or import the command(s) via an EPS file.

The following steps will create a transparent background on an imported graphic in FrameMaker using postscript text frames.

1. Create a new, empty file in FrameMaker.

2. To keep the postscript stuff in one place, switch to the Reference pages (<esc> v R).

CA number

Current stroking alpha constant, specifying the constant shape or constant opacity value to be used for stroking operations. Default is 1.0

ca number

Same as CA, but for fill operations. Default is 1.0

SMaskdictionary or

None

Current soft mask, specifying the mask shape or mask opacity values. Default is None

TK Boolean

The text knockout flag, which determines the behavior of overlapping glyphs within a text object. Default is true

Table 1: Graphics state parameters for transparency

Page 11: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

Creating transparency in PDFs with FrameMaker 7

3. Add a new Reference page (<esc> s p a) called “Postscript” (or whatever you want to call it).

4. Create a text frame on this page. The size isn’t really important, as later this frame will be adjusted to fit your actual text content.

5. Set the Fill to None for the text frame.Note: Create and apply paratag called “ps_code” for the code sample.

6. Enter the following code into the text frame:

The code is explained at the end of this process [see How this works on page 10].

7. Turn this frame into a postscript frame:

a) Select the text frame (ctrl+click).

b) Open the Object Properties window (<esc> g o).

c) Click on the Postscript Code check box in the Text Frame property to enable postscript.

d) Click on Apply.

gsave/Height exch def /Width exch def

[ /ca .5 /SetTransparency pdfmark1 1 1 setrgbcolor0 0 Width Height rectfill

grestore

Page 12: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

8 Creating transparency in PDFs with FrameMaker

8. Copy this frame to the clipboard (ctrl+c).

9. Switch to your Body pages (<esc> v B).

10. Import an image to use as a background (<esc> f i i).

11. Paste the postscript text frame into the Anchored frame with the image (ctrl+v).

12. SaveAsPDF selecting the Transparency joboptions created previously.

Page 13: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

Creating transparency in PDFs with FrameMaker 9

13. You should now see the following PDF displaying your image with a 50% transparent frame in the middle:

Not bad for a product that supposedly doesn’t support transparency!Note: If you encounter any errors in the postscript code (e.g. there’s a Distiller log

with error messages). You will need to edit the postscript code. You must change the postscript text frame back to a regular text in order to edit the text. Don’t forget to change the frame back to postscript frame before creating a PDF again.

Page 14: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

10 Creating transparency in PDFs with FrameMaker

How this works

The magic is in the pdfmark code in the postscript frame. Let’s examine what everything means.gsave/Height exch def /Width exch def[ /ca .5 /SetTransparency pdfmark1 1 1 setrgbcolor0 0 Width Height rectfill grestore

The gsave and grestore operators in line 1 and 7 respectively, encapsulate the contained code (lines 2-6), so that local changes can be made to the graphics environment without affecting the rest of the graphics in the document. The gsave pushes a copy of the pre-existing graphics state unto a stack. The grestore pops that back off and puts things back to the way they were before creating the transparency.

Each postscript text frame creates its own standalone environment, so everything specified within is relative to the frame itself. This means that you can move the frame around and re-size it without having to worry about specific values used in the postscript code to define size and loca-tions.

Note: All dimensions in postscript code are in point units.

When a postscript text frame is processed, the location and size of this text frame are pushed onto the stack. This information can then be retrieved to be used in defining such things as the area to fill. Lines 2 and 3 pull the frame height and width respectively [in that order] from the stack and load those into locally defined variables called Height and Width in this example.

Line 4 sets the fill transparency to 50% (/ca .5). You also could add stroke transparency (/CA) with a different value to give an enhanced border effect by drawing a rectangle.[see Enhanced example with a border on page 11]

Line 5 defines the colour space and the specific colour to be used. In this case, Red-Green-Blue colours set to give White. You could also use gray-scale (setgray), Cyan-Magenta-Yellow-blacK (setcmykcolor), or hue-sat-uration-brightness (sethsbcolor; in FM it’s hue-lightness-saturation, so the order is different if trying to match a colour). White is defined as 100% red, 100% green and 100% blue, hence the 1 1 1 setrgbcolor — val-ues will always range from 0 to 1.

1234567

Page 15: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

Creating transparency in PDFs with FrameMaker 11

Line 6 specifies a rectangle to be filled starting from the origin of the text frame (0,0) to the width and height of the frame. The rectfill operator both defines the shape and fills it.

Enhanced example with a border

You can add a bit of embellishment by creating a border effect using a modified set of instructions.

The following code adds a yellow 5pt border with 75% opacity (25% transparency).gsave/Height exch def /\Width exch def[ /ca .4 /CA 0.75 /SetTransparency pdfmark1 1 1 setrgbcolor5 setlinewidth0 0 Width Height rectfill1 1 0 setrgbcolor0 0 Width Height rectstrokegrestore

Analagous to the rectfill operator, the rectstroke operator draws the rect-angle outline (border) using the specified linewidth and colour.

Line 4 now adds a different level of opacity for the rectangle/frame out-line (75% in this case) by including the /CA key and value (0.75).

Line 6 sets the width of the line to use at 5pt.

Line 8 changes the color to Yellow (i.e. 100% red, 100% green and 0% blue).

Line 9 draws the outline (border) of frame in yellow with a width of 5pt.

Try it out

1. Go to your Reference page (Postscript)

2. Create a new text frame.

3. Copy and paste the sample code into the text frame (and tag it with the ps_code paratag, as mentioned earlier).

4. Change the text frame to a Postscript frame as shown in step 7. on page 7.

5. Copy the postscript text frame to the clipboard.

6. Go to your Body page.

123456789

10

Page 16: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

12 Creating transparency in PDFs with FrameMaker

7. Delete the original postscript text frame from the anchored frame with the graphic.

8. Paste the new text frame into the anchored frame.

9. Resize as desired.

10. SaveAsPDF (check that the Transparency joboptions are used).

11. The PDF should now look like this:

Adding the text to the transparent frame

To get the appearance of text in a transparent frame, you now have to add another text frame to the anchored frame to hold your content.

You will need to re-size the postscript text frame to the same size as the final content text frame. The final step is to overlay the content text frame over the postscript text frame keeping the stacking order of:

• image on the bottom,

• postscript frame in the middle

• content text frame on top.

Tips to make this easier

Working on the Reference pages is more convenient when setting up and superimposing the content text frame on the postscript text frame.

1. Switch to the Reference pages.

2. Create a Reference page for the content text frames (call it Content?).

3. Create a text frame and set the Fill to None.

Page 17: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

Creating transparency in PDFs with FrameMaker 13

4. Enter and format your content and adjust the size of the text frame as required, e.g.

5. Select the text frame and open the Properties window (<esc> g o).

6. Note on the Dimensions panel, the Width and Height values of the text frame, e.g.

Page 18: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

14 Creating transparency in PDFs with FrameMaker

7. Select the postscript text frame and open the Properties window (<esc> g o).

8. Change the height and width to match the size of the content text frame.

9. Copy the content text frame onto the postscript text frame reference page.

10. Select the content frame and the postscript text frame (with the desired transparency effect).

11. Use the Align graphics (<esc> g a) to specify both horizontal and vertical center alignment for the frames. This will superimpose the content text frame on top of the postscript text frame.

12. Group the frames (<esc> g g). This will now allow you to resize the frames as one entity.

Page 19: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

Creating transparency in PDFs with FrameMaker 15

At this point, you’ll notice that it’s a bit difficult to clearly see what’s in the content frame, especially if you have to make any edits.

Note: So how do we clean this up? Please refer to Making the postscript code text disappear on page 16 for details.

13. Copy the grouped frames to the clipboard.

14. Switch to the Body page.

15. Select the anchored frame with the image.

16. Paste the grouped frames into the anchored frame.

17. Re-size and re-position the text frames as desired on the underlying image.

18. SaveAsPDF (using the Transparency joboptions).

Page 20: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

16 Creating transparency in PDFs with FrameMaker

19. If you selected the postscript text frame with the border, you’re probably seeing the text right up and over top of the border. There’s a few extra steps required to make this scenario fit easier.

Before you superimpose and group the text frames, you could do this:

a) Select the postscript text frame.

b) Open the Properties window (<esc> g o).

c) Change the Width and Height on the Dimension panel to add twice the value used in the setlinewidth command for the border. In the previous example the linewidth was 5pt, so you need to add 2 x 5pt = 10pt to both the Height and Width.

d) Now proceed as shown in step 9. on page 14 to group the frames together.

Making the postscript code text disappear

Since the postscript code is all tagged [you did do this properly, right?] with the ps_code paratag, you can make the text invisible using a colour and FrameMaker’s ColorViews. No, it’s not as simple as making the post-script text very small and white — that’s not the proper way to do it.

Here’s how to make things invisible (i.e. FM knows about it, but it never gets into the output stream nor can you see it):

a) Create a new (bright) colour using FM’s Color Definition (call it ~Invisible) (<esc> v c d)

b) Open FM’s Color Views (<esc> v c v).

c) Select View 1 by clicking on the radio button.

Page 21: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

Creating transparency in PDFs with FrameMaker 17

d) Select the ~Invisible colour in the Normal column (on the left-side of the window).

e) Move, using the arrow buttons, it to the Invisible column on the right-side.

f) Click the Set button to finish configuring the colours.

g) Open the Paragraph Designer (ctrl+m).

h) Enter/select the ps_code paratag in the style list.

i) Select the Font tab/panel.

j) Change the Color: to ~Invisible.

k) Update the paratag.

The grouped text frames should now only be showing the text frame con-tent, making edits much easier.

If you need to make the postscript code visible for editing, then toggle to Color View 1. The shortcut is <esc> v 6.

To make the postscript invisible again, use the shortcut <esc> v 1 to change back to Color View 1.

Postscript Text Frames: A better way

There are a few things to make using postscript frames easier to (re-)use in documents.

Turning on/off One nuisance, is that in order to edit the content of a postscript text frame is that you have to always change the frame back and forth from a post-script one to a non-postscript one and back again for creating the PDF.

The better way is to create two Object Styles that already have the on/off settings pre-defined. You then only need to select the frame and apply the required style.

Page 22: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

18 Creating transparency in PDFs with FrameMaker

To create the styles:

1. Click somewhere outside of the text frame.

2. Open the Object Designer (ctrl + y or <esc> g o).

3. Select the Text Frame property.

4. Enable the PostScript Code option

5. Enter a name (e.g. PS_on) for this style in the Object Style line.

6. Save the style.

7. Repeat this for a PS_off style where the PostScript Code check box is empty to create the style to make the code editable.

Re-using postscript code

In order to re-use the desired effect in a document or other documents, you could always copy & paste the postscript text frame or create it from scratch, but this could be a lot of extra work.

Another way to do this is to let FrameMaker pull the postscript code from a file. You could be thinking of using text insets and having the code in various flows in another document — certainly one possible approach. But, FrameMaker also will include the content from another text file by using an #include "path:filename" statement in the PostScript text frame.

Page 23: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

Creating transparency in PDFs with FrameMaker 19

If the postscript file is in the same folder as the document, then you don’t need to specify the path.

This allows you to create a library of effects that you could access from any document. You then could create a simple postscript text frame with a single line that includes your desired effect and group this with an over-laying text frame [create it on a Reference page]. You will now have a “transparent” text frame (ready to accept content) that you can copy and then position and re-size as required over any graphic.

Caveats. As the #include statement is a FrameMaker command (and not postscript code) you must surround filename with straight-quotes ("filename") by turning SmartQuotes OFF. Otherwise, you will get an OffendingCommand #include error in Distiller. FM will fail to pull in the code to pass to postscript when generating the output and simply passes the #include statement.

Also, the entire line of the #include with filename must fit on a single line of the PS text frame. It must NOT wrap! Otherwise, FrameMaker will again fail to include the file. If you have a long path to the filename, then this could be an issue when re-sizing the text frames. The solution is to make the font tiny for the ps_code paratag using the Paragraph designer.

Using EPS files as an alternative way

Instead of creating postscript text frames, you could create an Encapsu-lated PostScript (EPS) file to inject the pdfmark and postscript operators into a FrameMaker file (or for that matter any application that supports EPS graphics). EPS files, like a postscript text frame, have a limited scope in what they affect. They are their own contained environment and have some formal requirements for their layout.

A sample of the basic EPS file format looks like this:

%!PS-Adobe-3.0 EPSF-3.0

%%BoundingBox: 0 0 100 100

%%EndProlog

... postscript and pdfmarks go here ...

% EOF

The main difference with the postscript text frame approach is that you must specify a size and use actual values for the shape dimensions. These will scale in FrameMaker as you resize and re-position an EPS file, but depending upon the type of effect coded, the results may be distorted after scaling. This can be another way to create different shape effects,

Page 24: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

20 Creating transparency in PDFs with FrameMaker

rather than a negative impact. For example, using the radial fill sample in Radial gradient effect (Type 3) on page 26, the following shows the effects of distorting the defined EPS file compared to the postscript text frame.

Note: When importing an EPS, set the fill of the imported file to None using FM’s graphic tools. FM always imports graph-ics with a default fill of White.

Layout in FrameMaker with postscript frame above EPS graphic

Result in PDF

As you can see, the postscript frame approach clips the circular gradient at the top/bottom as the width is greater than the height. However, the EPS approach scales the directions independently resulting in an ellipti-cal gradient.

Also note that, since there is no preview to the EPS, a background fill is shown in FrameMaker which obscures the underlying image. However, if you wish to place your text content on top of this, it provides a cleaner background for seeing the content while authoring/editing.

Page 25: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

Creating transparency in PDFs with FrameMaker 21

Additional background fills and transparency effectsThe transparency pdfmark can also use blending modes to create other visual effects. Additionally, postscript shading can be introduced to pro-duce linear and radial gradient effects or postscript tiling for repeated patterns on backgrounds. Both shading and tiling are special types of postscript patterns. Some of these are shown here. You can explore fur-ther, using these as a starting point.

Linear (axial) gradient effect (Type 2)

A gradient fill that creates a smooth transition between colours is called a shading pattern. If it occurs in single direction (i.e. linear) it is referred to as an Axial or Type 2 shading in postscript.

Here is some sample code to create a gradient fill with transparency going from left to right for a rectangular area:gsave/Height exch def /Width exch def[ /ca .5 /SetTransparency pdfmark<< /ShadingType 2 /ColorSpace /DeviceRGB /BBox [0 0 Width Height]

/Coords [0 0 Width 0] /Function << /FunctionType 2 /Domain [0 1]

/C0 [1 0.5 0]/N 1

>>>>shfillgrestore

123456789

1011121314151617

Page 26: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

22 Creating transparency in PDFs with FrameMaker

Line 1, as before, saves the pre-existing graphic environment.

Lines 2 and 3 retrieve the values of the postscript text frame’s width, height and populate the variables named Width and Height accordingly.

Line 4 sets a 50% transparency.

Line 5 starts the shading pattern definition used for the shfill (show me the fill!) operator in Line 16. The /ShadingType 2 specifies that smooth Axial shading is to be used.

Line 6 indicates that RGB colours will be used.

Line 7 defines a bounding box (equal here to the postscript text frame) for the fill.

Line 8 specifies the starting co-ordinate (0,0) of the gradient fill and the ending co-ordinate (Width,0). In this case a vector (left-to-right) along the X-axis (i.e. horizontal) axis of the rectangle.

Line 9 begins the Function Dictionary, which is used to specify how the fill colour will vary from the start point to the end point of the axis defined by the /Coords.

Line 10 says that the function will interpolate between two endpoints.

Line 11 says that the interpolation will begin 0 and end at 1.

Line 12 specifies the RGB colour [1 0.5 0] (pale orange in this case) at start, hence /C0. A colour for the end-point can also be defined using /C1 and the RGB values. If either C0 or C1 is used alone, then fill goes from the starting colour to white for C0 or to black for C1

Line 13 provides the number to use for the exponent in the interpolation formula used. The value of 1, means a linear interpolation is wanted. A value of 2 means quadratic, 3 means cubic, etc.

Lines 14 and 15 just terminate the definitions for the Function Dictio-nary and the shading pattern, respectively.

Line 16 shows the fill

Line 17 restores the previous graphics environment.

Page 27: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

Creating transparency in PDFs with FrameMaker 23

Examples of effects due to varying coordinates

Changing the starting and ending values of the /Coords (Line 8 of the example) alters the direction of the gradients as shown in this example:

A, B, E, F, I and J have the colour specified at the start (C0), while the oth-ers specify the colour at the end (C1). This shows how you can blend to a light or dark shade.

A and C show left-to-right gradients: /Coords [0 0 Width 0]

B and D show right-to-left gradients: /Coords [Width 0 0 0]

E and G show bottom-to-top gradients: /Coords [0 0 0 Height]

F and H show top-to-bottom gradients: /Coords [0 Height 0 0]

I and K show diagonals from lower left to upper right:/Coords [0 0 Width Height]

J and L show diagonals from upper left to lower right:/Coords [0 Height Width 0]

Page 28: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

24 Creating transparency in PDFs with FrameMaker

Examples of effects due to varying exponent

Changing the exponent (/N) value (Line 13 of the example) affects how quickly the colour varies in the gradient.

Page 29: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

Creating transparency in PDFs with FrameMaker 25

Examples using two colours

Adding another colour definition (/C1) after Line 12 in the example will create a gradient fill between the two colours instead of just white or back if a single colour were defined.

In this example, blue /C1 [0 0 1]was added in Line 13 as colour at the end point of the axial (linear) shading from left (pale orange) to right (blue):

gsave/Height exch def /Width exch def[ /ca .5 /SetTransparency pdfmark<< /ShadingType 2 /ColorSpace /DeviceRGB /BBox [0 0 Width Height]

/Coords [0 0 Width 0] /Function << /FunctionType 2 /Domain [0 1]

/C0 [1 0.5 0]/C1 [0 0 1]/N 1

>>>>shfillgrestore

123456789

101112131415161718

Page 30: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

26 Creating transparency in PDFs with FrameMaker

Radial gradient effect (Type 3)

This shading effect is defined to occur as a colour blend between two cir-cles. This can give a 3D type of effect to a sphere or cone. This is referred to as a Type 3 shading in PostScript.

The code is similar to the Axial shading one, except for the /Coords defi-nition. This time it defines the center of the starting circle (X0, Y0) and radius (R0) and the center of the ending circle (X1, Y1) and radius of that circle (R1). gsave/Y exch def/X exch defY 0.5 mul /Y2 exch defX 0.5 mul /X2 exch defgsave[ /ca .5 /SetTransparency pdfmark<< /ShadingType 3

/ColorSpace /DeviceRGB /BBox [0 0 X Y] /Coords [X2 Y2 0 X2 Y2 Y2] /Extend [false false] /Function << /FunctionType 2

/Domain [0 1]/C0 [1 0.5 0]/N 1 >>

>>shfillgrestore

123456789

101112131415161718192021

Page 31: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

Creating transparency in PDFs with FrameMaker 27

In the code example, X and Y are used as the variable names for the width and height, respectively, of the postscript text frame. Only the differences between the code for Axial (Type 2) shading are explained here:

Lines 4 and 5 define new variables (X2, Y2) as the mid-points of the post-script text frame by multiplying the X and Y values by 0.5, i.e. taking one-half.

Line 8 declares that the fill will be radial, i.e. type 3.

Line 11 positions the circles to use for blending. The first circle is located at (X2, Y2) (i.e. the mid-point of the frame) and has a radius of zero (0) so it will behave as a point from which the colour will flow out of. The second circle is also located at the mid-point and has a radius of half the text frame’s height(Y2). The values are entered as two triplets, i.e. x, y and radius.

Line 12 is an optional entry to specify whether or not to extend the shad-ing beyond the starting and ending circles. The default values are bool-ean false and false. If the second value in the example where true, then that would allow the second circle’s colour to continue filling out to the bounding box edges specified in Line 10 (i.e. the postscript text frame).

Examples of effects varying Extend properties

The top row shows C0 colouring, with the following extend permissions:A /Extend [false false]B /Extend [false true]C /Extend [true false]D /Extend [true true]

Page 32: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

28 Creating transparency in PDFs with FrameMaker

Allowing the second circle to extend is the only parameter that affects the area outside of the circle itself.

The middle row shows C1 colouring in the same order of /Extend as the top row.

The bottom row shows two-colour blending (C0 & C1) with the same extend modes as the other rows.

Examples of effects varying exponent N

The rate of the fill is shown here as function of the exponent N used in the Function definition. The smaller value exponents would be good for creating specular type effects, especially if the center of the inner circle is offset slightly (i.e. it could look like a light source).

Page 33: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

Creating transparency in PDFs with FrameMaker 29

Transparent imagesIf you really need to make the image transparent, then there’s a bit more work involved. This is due to Postscript not directly supporting image file formats (TIFF, JPG, PNG, GIF, BMP, etc.) — so let’s jump through a few hoops.

The image file needs to be decoded into a rectangular array of sample val-ues, so this means that you need to know how the file was encoded (i.e. what if any compression scheme was used) in the first place. Then the format of the image file needs to be known, i.e. the number of rows and columns in the image, the number of colour components per sample and the number of bits per colour component.

This means that you need to know quite a few details of the image file in order to use it in the postscript code. Using your image editing or viewer software, or even the Windows Properties > Detail tab of the file in Explorer, you should be able to determine the height and width in pixels, the number of bits per pixel and the colourpace used (hence number of components).

Knowing that information, one can produce a transparent image, like the following example (the yellow frame is on the postscript text frame):

Page 34: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

30 Creating transparency in PDFs with FrameMaker

JPG image example

Analyzing the same horses running on the beach JPG image as used in other examples, the following information is determined:

• width = 1280 pixels• height = 720 pixels• colourspace = RGB• components = 3

The postscript code to insert the horses JPG as a transparent image is:/Y exch def /X exch defpop pop/Ximg 1280 def/Yimg 720 def/AspectRatio Ximg Yimg div defXimg Yimg ge {/Xscale X def /Yscale X AspectRatio div def } {/Yscale Y def /Xscale Y AspectRatio mul def } ifelse[ /ca 0.6 /SetTransparency pdfmark/DeviceRGB setcolorspace (E:/Test/Fm_transparency/Horses.jpg) (r) file/File_img exch def/Data {File_img /DCTDecode filter} defgsave0 0 translate Xscale Yscale scale << /ImageType 1 /Width Ximg /Height Yimg /ImageMatrix [Ximg 0 0 Yimg -1 mul 0 Yimg ] /DataSource Data /BitsPerComponent 8 /Decode [0 1 0 1 0 1] >> imagegrestore

Lines 1–3 get the postscript text frames width, height and clear the start-ing co-ordinates of the frame from the stack (the two pops).

Lines 4–5 specify the dimensions, in pixels, of the image file. [The values that you have to manually determine a priori.]

Line 6 determines the aspect ratio of the image by dividing the width (Ximg) by the height (Yimg).

123456789

101112131415161718192021222324252627282930

Page 35: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

Creating transparency in PDFs with FrameMaker 31

Lines 7–13 specify the scaling to use depending upon the aspect ratio. If the ratio is greater than 1, then the image is fit in the horizontal direction (i.e. to X, a Landscape mode). Otherwise, the image is fit in the vertical direction (i.e. to Y, a Portrait mode). This scaling does not distort the image. The scaling is the postscript text frame size with the appropriate axis adjusted by the aspect ratio.

Line 14 specifies that an opacity of 60% (i.e. 40% transparent) is to be used.

Line 15 specifies that the RGB colourspace is to be used (as determined from the image).

Note: You must specify the entire path to the file for this to work properly.

Line 16 creates a file object to read the image. The file name, including the path, must be enclosed in parentheses.

Line 17 assigns this object to a variable.

Line 18 is where the image samples get stored (and assigned to an object called Data in this case). The file is read and decoded using the DCTDecode (Discrete Cosine Transform) filter that is used in JPG files. There are nine (9) different decode filters available in PostScript, so you need to know the file type that you are importing and how the data was originally encoded, in order to properly decode the samples for use. With PNG files, the FlateDecode is needed. Whereas, for a TIF file, you may need LZWDecode, CCITTFaxDecode, RunLengthDecode, etc. and some of these may require additional parameters to properly decode the data. The details of all of these decode filters are described in the PostScript Language Reference Manual.

Line 19 saves the current graphics environment.

Line 20 ensures that the image is placed at the origin (lower left) of the postscript text frame.

Line 21 specifies how to scale the image data to fit the postscript text frame (based upon the Aspect ratio as specified in Lines 7–13).

Line 22 begins the image dictionary/operator that paints the image within the text frame. The ImageType must be 1.

Lines 23–24 specify the width and height in pixels of the image.

Line 25 specifies the transformation matrix defining the positioning of the image within the postscript text frame space. The first pair of values give the location of the origin of the image (typically an image begins in with the upper right pixel). The second pair of values specify the orien-tation of the x and y axes (Yimg -1 mul is used to specify a negative/down-ward direction for image starting at the top row). The third pair specify

Page 36: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

32 Creating transparency in PDFs with FrameMaker

the translation displacement required when placing the pixel (i.e. move the image down so that the last row is along the bottom of the postscript text frame).

Line 26 specifies where the image samples are coming from (the object called Data in this case; Line 18).

Line 27 specifies the number of bits used to define each colour compo-nent. Only a single value (i.e. it’s the same for all components) is used and can be one of 1, 2, 4, 8 or 12. In this case, it’s 8 bits per pixel (otherwise known as 24-bit encoding for RGB).

Line 28 specifies an array of numbers that describe how to map the image samples into a range of values used in the current colour space. The length must always be twice the number of colour components of the current colour space (Line 15). The values will always be 0 or 1. For this image using RGB, six values are required [0 1 0 1 0 1]. The details of all of these decode arrays are described in the PostScript Language Reference Manual.

Line 29 ends the image dictionary definition and paints the image within the postscript text frame.

Line 30 restores the original graphics environment.

An easier way: EPS format

That was quite a bit of work for a simple image. The steps there are more for the benefit of anyone wishing to script the functionality. So is there an easier to do this? Of course, use an EPS file.

EPS files can contain both vector and raster information. Most imaging applications will also let you save an image as an EPS file. This simplifies things a lot, as the conversion to postscript code has already been done for you. The only thing you need to do is to find out the BoundingBox values that are specified for the image. You need to keep in mind that these values represent the physical size (in points; 1/72 of an inch) of the image, rather than the height and width in pixels, as used in the JPG example.

An EPS file can be read by most text editors or you can use the command line "findstr BoundingBox filename.eps" to get the bounding box values. Using the horses file converted from JPG to EPS, the bounding box has a width of 960pt and a height of 540pt. The JPG was created at 96dpi, so the bounding box value for width is calculated during the conversion to EPS as 1280 pixels * 96dpi / 72 points per inch = 960pt. Likewise, the

Page 37: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

Creating transparency in PDFs with FrameMaker 33

height calculates to 540pt. The bounding box values are shown in the following findstr query:

So, only needing the width and height along with the name of the EPS file, the postscript code to create a transparent image is:/Y exch def /X exch defpop pop/Xbox 960 def/Ybox 540 def/AspectRatio Xbox Ybox div defXbox Ybox ge {/Xscale X Xbox div def /Yscale Xscale def } {/Yscale Y Ybox div def /Xscale Yscale def } ifelse[ /ca .6 /SetTransparency pdfmarkgsave0 0 translateXscale Yscale scale(E:/Test/Fm_transparency/Horses.eps) rungrestore

Lines 1–3 get the postscript text frames width, height and clear the start-ing co-ordinates of the frame from the stack (the two pops).

Lines 4–5 specify the bounding box values (width and height) of the EPS file [which you have to determine a priori].

Line 6 determines the aspect ratio of the image by dividing the width (Xbox) by the height (Ybox).

Lines 7–13 specify the scaling to use depending upon the Aspect ratio. If the ratio is greater than 1, then the image is fit in the horizontal direction (i.e. to X, a Landscape mode). Otherwise, the image is fit in the vertical direction (i.e. to Y, a Portrait mode). This scaling does not distort the

123456789

10111213141516171819

Page 38: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

34 Creating transparency in PDFs with FrameMaker

image. The scaling is calculated by using the ratio of the postscript text frame size to the image bounding box size.

Line 14 specifies that an opacity of 60% (i.e. 40% transparent) is to be used.

Note: You don’t need to specify the colour space, as this is defined within the EPS file.

Line 15 saves the current graphics environment.

Line 16 ensures that the image is placed at the origin (lower left) of the postscript text frame.

Line 17 specifies how to scale the image data to fit the postscript text frame (based upon the Aspect ratio as specified in Lines 7–13).

Note: You must specify the entire path to the file for this to work properly.

Line 18 processes the contents of the specified EPS file. The file name, including the path, must be enclosed in parentheses.

Line 19 restores the original graphics environment.

That was a lot easier, wasn’t it? You don’t have to know any other details of the image other than the size given by the bounding the box.

SummaryWith just a little a bit of work, you can now apply transparency effects to text frames and images in FrameMaker and create live transparency in PDFs. Additionally, other postscript effects, such as linear/axial and radial gradients can also be applied to text frames. This opens the door for some interesting and creative effects.

The take aways from this tutorial are:

• create a Distiller joboptions file with /AllowTransparency true

• create Object styles to toggle Postscript text frames on and off

• create small text files for the postscript code or work on your Reference pages

• use the #include "path:filename" statement to keep things simple in the FrameMaker documents and for re-use in multiple files

• use EPS files if you want to create transparency in images

For the scripting aficionados, hopefully, you should have enough infor-mation now to be able to create your own scripts to apply these affects in a more transparent manner.

Page 39: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

Creating transparency in PDFs with FrameMaker 35

ReferencesAdobe Systems Incorporated., PostScript Language Reference, third edi-tion; ISBN 0-201-37922-8https://www.adobe.com/products/postscript/pdfs/PLRM.pdf

Adobe Systems Incorporated., Adobe® Acrobat® DC SDK pdfmark Refer-ence for Microsoft® Windows®, Mac OS®, Linux®, and UNIX®; Edition 2.0, May 2015

Adobe Systems Incorporated., Adobe® Acrobat® DC SDK Adobe PDF Cre-ation Settings for Microsoft® Windows® and Mac OS®, Edition 1.0, May 2015

Deubert, John: Acumen Journal — PostScript Tech.http://www.acumentraining.com/acumenjournal.html

Lancaster, Don: PostScript Library. Don Lancaster's Guru's Lair.http://www.tinaja.com/post01.shtml

Merz, Thomas. Web Publishing with Acrobat/PDF. Springer-Verlag Ber-lin, 1998. Chapter 6, “pdfmark Primer”, is available on-line from: www.pdflib.com/fileadmin/pdflib/pdf/pdfmark_primer.pdf

Perets, Shlomo. FrameMaker-to-Acrobat Advanced Techniques, Course Workbook, 2001

Page 40: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

36

Blend mode in transparencyOne of the optional parameters when specifying transparency is the blend mode (/BM parameter). This defines how the background colours interact with the transparent colours of the object on top. There are 16 different blend modes currently available. The details of these are defined in the PDF Reference manual (Section 11.3.5 Blend Mode p.324).

This section shows how the various blend modes behave so that you can get a feel for what you may need. In most cases, you probably want to use the default /Normal mode.

The following pages show examples of a transparent image placed on an opaque multi-coloured gradient background. All of the blend modes are applied to the image. The graphics are then switched on the next page, with the multi-coloured gradient (with applied transparency and all blend modes applied) in front of the now opaque image file.

There are quite a bit of differences between the two scenarios.

The postscript code for the first scenario follows (only the highlighted pdfmark line was varied):/Y exch def /X exch defpop pop/Xbox 720 def/Ybox 1080 def/AspectRatio Xbox Ybox div defXbox Ybox ge {/Xscale X Xbox div def /Yscale Xscale def } {/Yscale Y Ybox div def /Xscale Yscale def } ifelse[ /ca .5 /BM /Normal /SetTransparency pdfmarkgsave0 0 translateXscale Yscale scale(E:/Test/Fm_transparency/cat_cropped2.eps) rungrestore

Page 41: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

©4/

17/1

7 A

G In

form

atio

n Sy

stem

s Ltd

. — C

onte

nts a

re c

opyr

ight

ed.

37

Normal Multiply Screen Overlay

Darken Lighten ColorDodge ColorBurn

HardLight SoftLight Difference Exclusion

Hue Saturation Color Luminosity

Cat in front (50% transparency)

Page 42: FrameMaker Transparency in PDFs · The following steps will create a tran sparent background on an imported graphic in FrameMaker using postscript text frames. 1. Create a new, empty

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

©4/17/17 A

G Inform

ation Systems Ltd. —

Contents are copyrighted.

38

Normal Multiply Screen Overlay

Darken Lighten ColorDodge ColorBurn

HardLight SoftLight Difference Exclusion

Hue Saturation Color Luminosity

Spectrum in front (50% transparency)