When exporting a PDF file, how can a watermark be created that has multiple
lines of text?
Solution
There is no way to create multi-line watermark text from inside NX. The cgm2pdf
command line utility has to be used.
This command line utility has an argument (-wfile) to allow a text file
(*.txt) as input for the watermark. And if the text file has multiple lines of
text, then so will the watermark.
1. Export the drawing to a CGM file.
2. Create the watermark text file like the following:
---------------------------------------------------------
#OPACITY=.3
#SCALE=1.0
#DIRECTION=HORIZONTAL
#ANCHOR=5
This watermark should have
multiple lines of text.
---------------------------------------------------------
Watermark file instructions:
A. Place text to be used for the watermark on an open line (no comment #).
B. Make sure the text file has one <return> to create one empty line at the end
of the file.
Watermark options that can be used in the watermark text file are as follows:
· #OPACITY=<number>, where <number> is a decimal number from 0 to 1. The
default is .3.
· #SCALE=<number>, where <number> is a decimal number. The default is the page
size.
· #DIRECTION=<keyword>, where <keyword> is given as VERTICAL, HORIZONTAL, or
DIAGONAL. The default is DIAGONAL.
· #ANCHOR= =<number>, where <number> is the anchor point given by a value.
Allowable values are:
o 1 = Top left
o 2 = Top center
o 3 = Top right
o 4 = Center left
o 5 = Center
o 6 = Center right
o 7 = Bottom left
o 8 = Bottom center
o 9 = Bottom right
The default value is 5 (Center).
3. Open an NX Command Prompt: 'Start-->All Programs-->Siemens NX 9.0-->NX
Tools-->Command Prompt'.
4. Run the cgm2pdf.exe utility using the following syntax:
cgm2pdf.exe -wfile=<watermark_file> cgm_filename.cgm pdf_filename.pdf
I have used the entire path to all the files so they are found and used.
For example:
D:\NX9\NXPLOT\bin\pdf\cgm2pdf.exe
-wfile=D:\user_files\watermark_text.txt D:\user_files\drawing.cgm
D:\user_files\drawing.pdf
Notes and References
Hardware/Software Configuration
Platform: all
OS: n/a
OS Version: n/a
Product: NX
Application: GATEWAY
Version: V9.0
Function: PDF
Ref: 001-7771896