|
Digital Watermarks for Today's Engineer
by John Tucker, Raytheon Vision Systems
The Why
Clearly identifying engineering documentation as PRELIMINARY or DRAFT can prevent costly downstream misunderstandings. From program management to supply chain, each function in the enterprise must clearly understand whether or not engineering information is released for production.
Now, if you have a printer compatible with PostScript® or a PDF distiller, you too can identify your documents with a fully automated, digital, customizable “watermark”bringing the outdated “red stamp” into the modern age.
The What
A watermark is here defined as a semi-transparent marking that unmistakably identifies the release state of Pro/ENGINEER output without obstructing the readability of information underneath or behind it. A good watermark looks like a light fog superimposed over the engineering print or PDF (Fig. 1). It does not obscure the documentation and is difficult to ignore.

Figure 1.
The How
You can set up a watermarking system for your users that employs simple menu selections to print a file or create a PDF in Adobe® Reader® format. Ideally, the watermarking process should be transparent to the user. That is, the watermark should be automatically applied based on the release state of your databases.
If you are using Pro/INTRALINK, Windchill, or another PDM system to manage your Pro/ENGINEER files, you need only query your system to determine whether or not to add a watermark. If you are still using your operating system’s innate filing system to manage your files, you won’t be able to automate the process unless you use drawing parameters to track your release state and are extremely disciplined about keeping them up to date. Nonetheless, you can still choose to apply a watermark based on, for example, an alternate menu selection or a mapkey.
The Watermark Recipe
There are three steps for applying a watermark to your output:
1. Create a PostScript file.
Create a PostScript file, sending the output to a file, or record a Pro/ENGINEER mapkey to do the job. If you are tracking your lifecycle state with Pro/INTRALINK, your mapkey should include a file dump of your model or drawing parameters, so that you can inspect the resulting file and obtain the release level. Knowing the release state of your data will allow you to further customize the watermark or simply forgo it.
2. Insert the watermark.
The watermark itself is composed of 18 lines of PostScript code embedded into the PostScript file created by Pro/ENGINEER. The PostScript code is available (click here to download). (Note: in Adobe lingo, the watermark is actually a “background,” so if you plan to use shaded views in Wildfire 3.0, your shaded views will clip your text.)
3. Obtain paper or PDF output.
a. Use the ‘lp’ command or Windows print command to send your PostScript file to a printer. If you cannot use the print command in your Windows environment (as may be the case because of your network architecture), you can use the excellent freeware PrintFile (go to http://www.lerup.com/printfile/ for instructions and download) to send your PostScript files to your system printer.
b. PDF output may be obtained via your Adobe distiller or a product such as GhostScript.
Insertion Tips
You cannot insert the 18 lines of PostScript code just anywhere into the Pro/ENGINEER PostScript output file. Currentlythis applies to Pro/ENGINEER 20 through Pro/ENGINEER Wildfire 3.0 Preproductionit must be inserted after either line 14 or 15 of the output. To insert the code quickly and easily into the correct location without writing a custom routine, make use of the SED program that comes with your operating system. If you use Windows, download a freeware version of SED from the internet. (I’m using super-sed version 3.59 available at http://sed.sourceforge.net/grabbag/ssed/sed-3.59.zip. I’ve renamed the executable to SED.exe and placed it into our operating system path.)
Copy the text in Figure 2 exactly and name it watermark.sed. Place it in a folder of your choosing.
p
/%%EndPageSetup/ a\
/theWatermark {[(DRAFT/REVIEW) (YOUR CUSTOMIZED) (WATERMARK HERE)]} def\
/globalScaleFactor {4} def\
/grayScale {0.95} def\
/interLinearSpacing {0.5} def\
/getmidpage {currentpagedevice /PageSize get dup 0 get exch 1 get exch 2 div exch 2 div} bind def\
/corner2corner {currentpagedevice /PageSize get dup 0 get exch 1 get exch atan} bind def\
/getsheetscal {currentpagedevice /PageSize get 0 get 72 div globalScaleFactor mul} bind def\
/sizefont {/Helvetica-Bold findfont exch scalefont setfont} bind def\
/showcenterjust {dup stringwidth pop 2 div neg 0 rmoveto show} bind def\
/numwatermarklines {theWatermark length} bind def\
/watermark {gsave newpath getmidpage moveto corner2corner rotate 0 getsheetscal 2 div neg rmoveto\
0 numwatermarklines 1 sub getsheetscal mul interLinearSpacing mul rmoveto getsheetscal sizefont\
grayScale setgray theWatermark {gsave showcenterjust grestore 0 2 getsheetscal mul interLinearSpacing mul\
neg rmoveto} forall\
grestore} bind def\
<<\
/BeginPage {watermark} bind\
>> setpagedevice\
|
Figure 2.
Let’s assume that you’ve just printed your PostScript output to a file. Let’s further assume that the file is called my_drawing.ps. Use the following command line to transform your Pro/ENGINEER PostScript file into a watermarked PostScript file:
sed -n -f watermark.sed my_drawing.ps >watermarked.ps
The file named watermarked.ps now contains a watermark, which will become visible when you send it to a PostScript-compatible printer or a distiller. You may delete the input file named my_drawing.ps at your leisure.
Customizing Your Mark
Take note of the following in the SED script shown in Figure 2.
- Text. The text of the watermark (in red) is customizable. Your watermarks may contain a single line of text, such as the word DRAFT, or they may contain several lines of text. It’s possible to use a different watermark for different purposes: quotation, review, release, draft, etc. In any case, all watermark text must be set between the two square brackets. Each line of text in the watermark must be set between parentheses. If you need to use parentheses in your watermark, prefix them with the back-slash character \.
- Font size. The overall size of the watermark lettering (in blue) is adjustable. Experiment with the size of the lettering by varying this setting. This is a positive real number. Start with the given value 4, adjusting downward if your watermark spills off of the page, and adjusting upward if it looks too small. Remember to test it for each of your standard page sizes. Save to watermark.sed when satisfied.
- Line spacing. The interlinear spacing of the watermark (in pink) is adjustable. This is also a positive real number. The current spacing of 0.5 indicates that there is one half-height of character spacing between lines of text in the watermark. Adjust it up or down to achieve a pleasing effect. Remember to save this to watermark.sed when you’re happy with it.
- Intensity. The intensity of the watermark (in green) is adjustable. This is a real number ranging from 0.0 to 1.0. A value of 0.0 will set your watermark to full black; you will not be able to view any other output behind it. A value of 1.0 indicates full white; your watermark will be invisible! I have noticed that a different value for intensity may be required depending on whether you output to a printer or to a PDF file. In addition, if you obtain obviously stippled (dotted) output from your printer, make sure that you are using a PostScript driver supplied with your operating system or by your printer manufacturer. If necessary, change the driver through your operating system control panel to achieve a smoother effect.
Printing Made Easy
There isn’t room to go into every possible system configuration in this article. However, for Windows users, I have created a Pro/ENGINEER printer configuration file (PCF file) and a batch file as a sample. Instructions for use follow.
- Download a Windows-compatible version of SED. (You can get it here.) Unzip it and rename it to SED.exe.
- Download and install Ghostscript (http://www.ghostscript.com/).
- Place the provided PCF file watermark.pcf into the folder designated by pro_plot_config_dir in your config.pro. If there is no special setting for this folder, place the PCF file into the folder <loadpoint>\text\plot_config along with the other PCF files. Edit lines 10 and 14 of the file according to the instructions on lines 9 and 13. Save the edited file as plain text.
- Edit the batch file watermark.bat with your favorite text editor. You’ll need to make edits to the first 10 SET commands to customize them to your setup (editing instructions are provided within the file). Save the edited file as plain textwith the original nameand place it in the folder you designated when editing watermark.pcf in Step 3.
- Record a mapkey that selects the printer WATERMARK, or manually print using the WATERMARK printer (Fig 3). Be sure to leave both boxes To File and To Printer checked (Fig. 4). Make any other selections you want, and press OK. The batch file should run, prompting you to fix any clerical errors you may have made during editing. If there are no errors, you’ll be asked whether you’d like to print your file or create a PDF. Either way, you’ll get output with a watermark.

Figure 3.

Figure 4.
Conclusion
The advent of email has changed the way we do business, cutting costs and reducing time-to-market. Along with these benefits comes the possibility of confusion and misinterpretation of information. But using the watermarking system described here, you can mail a PDF to customers for review, or to suppliers for quote, without any possibility of misunderstanding. Meanwhile, as paper documentation travels between offices in your own facility for design reviews and manufacturing planning, no one can possibly fail to recognize the design phase of your product. 
John Tucker is a mechanical engineer at Raytheon Vision Systems. He can be reached by email at jtucker@raytheon.com.
Trademark acknowledgments: Windows is a registered trademark of Microsoft Corporation in the United States and other countries. Adobe, PostScript and Reader are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries.
|
|
|
|