Difference between revisions of "LaTeX/C3/Adding-a-Watermark-to-a-Document/English"

From Script | Spoken-Tutorial
Jump to: navigation, search
(Created page with "'''Title of the Script: Adding a Watermark to a Document''' '''Author: Ambika Vanchinathan''' '''Keywords: '''LaTeX, Draftwatermark, watermark text, customized watermark, st...")
 
Line 14: Line 14:
  
 
'''Title Slide'''
 
'''Title Slide'''
|| Welcome to the spoken tutorial on '''Adding a Watermark to a Document'''
+
|| Welcome to the spoken tutorial on '''Adding a Watermark to a Document'''.
 
|-  
 
|-  
 
|| '''Slide 2'''
 
|| '''Slide 2'''
Line 20: Line 20:
 
'''Learning Objectives'''
 
'''Learning Objectives'''
 
|| In this tutorial, we will learn to,
 
|| In this tutorial, we will learn to,
 +
 
* Create and customize watermarks using the draftwatermark package
 
* Create and customize watermarks using the draftwatermark package
 
* Control watermark visibility on specific pages
 
* Control watermark visibility on specific pages
* Use the eso-pic package for watermarking over the images
+
* Use the '''eso-pic''' package for watermarking over the images
 
|-  
 
|-  
 
|| '''Slide 3'''
 
|| '''Slide 3'''
Line 47: Line 48:
 
|| The following code files are required to practice this tutorial.
 
|| The following code files are required to practice this tutorial.
  
These files are provided in the Code Files link of this tutorial page.
+
These files are provided in the '''Code Files''' link of this tutorial page.
 
|-  
 
|-  
 
||
 
||
Line 55: Line 56:
  
 
'''\usepackage{draftwatermark}'''
 
'''\usepackage{draftwatermark}'''
|| This command imports the draftwatermark package.
+
|| This command imports the '''draftwatermark''' package.
 
|-  
 
|-  
 
|| Select '''XeLaTeX typesetting '''option from the dropdown.
 
|| Select '''XeLaTeX typesetting '''option from the dropdown.
Line 73: Line 74:
 
|| Let us comment line 7 and
 
|| Let us comment line 7 and
  
uncomment line 8
+
uncomment line 8.
  
Let’s run the code
+
Let’s run the code.
  
 
The''' watermark''' is printed only on the first''' '''page.
 
The''' watermark''' is printed only on the first''' '''page.
Line 96: Line 97:
 
Watermark '''Draftcopy '''is printed across all the pages.
 
Watermark '''Draftcopy '''is printed across all the pages.
  
Observe the options given in the \'''DraftwatermarkOptions '''command.
+
Observe the options given in the '''\DraftwatermarkOptions '''command.
 
|-  
 
|-  
 
|| '''Comment line 12'''
 
|| '''Comment line 12'''
Line 122: Line 123:
 
|| Uncomment line 28 and run the code.
 
|| Uncomment line 28 and run the code.
  
'''color '''keyword''' '''changes the''' '''watermark colour  
+
'''color '''keyword''' '''changes the''' '''watermark colour.
  
 
Here it changes to '''blue'''
 
Here it changes to '''blue'''
Line 128: Line 129:
 
We can also use values like '''[gray]{0.5} '''or '''[rgb]{1, 0, 1}.'''
 
We can also use values like '''[gray]{0.5} '''or '''[rgb]{1, 0, 1}.'''
  
That is by '''name '''and its '''strength '''or with the '''rgb '''option.
+
That is by '''name ''' and its '''strength '''or with the '''rgb '''option.
  
 
For that we have to load \'''usepackage{xcolor}''' in the preamble.
 
For that we have to load \'''usepackage{xcolor}''' in the preamble.
Line 144: Line 145:
  
 
Run the code and show the output
 
Run the code and show the output
|| Uncomment line 30
+
|| Uncomment line 30.
  
 
Run the code
 
Run the code
  
Here is the output
+
Here is the output.
  
 
'''hpos''' keyword  
 
'''hpos''' keyword  
  
changes the horizontal position''' '''of the watermark.
+
changes the horizontal position of the watermark.
 
|-  
 
|-  
 
|| '''uncomment line 31'''
 
|| '''uncomment line 31'''
Line 161: Line 162:
 
Run the code
 
Run the code
  
Here is the output
+
Here is the output.
  
'''vpos '''keyword changes the''' '''vertical position''' '''of the watermark.
+
'''vpos '''keyword changes the''' '''vertical position of the watermark.
 
|-  
 
|-  
 
|| '''uncomment line 32'''
 
|| '''uncomment line 32'''
Line 172: Line 173:
 
Run the code.
 
Run the code.
  
'''angle '''keyword in '''the command '''changes the angle''' '''of the watermark  
+
'''angle '''keyword in '''the command '''changes the angle of the watermark  
  
 
Here it changes to 60''' degrees.'''
 
Here it changes to 60''' degrees.'''
Line 206: Line 207:
 
Notice that all the options are given in a single line of code.
 
Notice that all the options are given in a single line of code.
  
Here watermarking text is EduPyramids.
+
Here watermarking text is '''EduPyramids'''.
 
|-  
 
|-  
 
||  
 
||  
Line 214: Line 215:
 
|-  
 
|-  
 
|| '''Comment the lines 34 and 7'''
 
|| '''Comment the lines 34 and 7'''
|| Comment the lines 34 and 7
+
|| Comment the lines 34 and 7.
 
|-  
 
|-  
 
|| '''Uncomment the lines from 36 to 48'''
 
|| '''Uncomment the lines from 36 to 48'''
|| Uncomment the lines from 36 to 48
+
|| Uncomment the lines from 36 to 48.
 
|-  
 
|-  
 
|| '''Highlight line 36'''
 
|| '''Highlight line 36'''
Line 224: Line 225:
  
 
'''Highlight Line 46'''
 
'''Highlight Line 46'''
|| In line 36, we load the eso-pic package.  
+
|| In line 36, we load the '''eso-pic''' package.  
  
 
We use this package to get a watermark on top of the images.
 
We use this package to get a watermark on top of the images.
Line 232: Line 233:
 
This command defines the watermark’s text colour to blue and the text to '''Confidential'''.
 
This command defines the watermark’s text colour to blue and the text to '''Confidential'''.
  
Line 46 instructs the compiler to ship out every page with the watermark on foreground
+
Line 46 instructs the compiler to ship out every page with the watermark on foreground.
 
|-  
 
|-  
 
|| Let’s run the code to see the output.
 
|| Let’s run the code to see the output.
Line 239: Line 240:
 
|| Let us run the code
 
|| Let us run the code
  
Now we see the watermark on the image too
+
Now we see the watermark on the image too.
  
Watermarking it with blue''' '''colour and with the text '''Confidential'''
+
Watermarking it with blue colour and with the text '''Confidential'''.
 
|-  
 
|-  
 
|| '''Slide 6'''
 
|| '''Slide 6'''
Line 265: Line 266:
 
* '''Angle''': 60 degrees
 
* '''Angle''': 60 degrees
  
|| As an '''Assignment '''add a watermark with the following attributes.
+
|| As an '''Assignment ''', add a watermark with the following attributes.
 
|-  
 
|-  
 
|| '''Slide 8'''
 
|| '''Slide 8'''

Revision as of 13:22, 21 October 2025

Title of the Script: Adding a Watermark to a Document

Author: Ambika Vanchinathan

Keywords: LaTeX, Draftwatermark, watermark text, customized watermark, stamp, hpos, vpos, angle, color, text, DraftWatermarkOptions, video tutorial.


Visual Cue Narration
Slide 1

Title Slide

Welcome to the spoken tutorial on Adding a Watermark to a Document.
Slide 2

Learning Objectives

In this tutorial, we will learn to,
  • Create and customize watermarks using the draftwatermark package
  • Control watermark visibility on specific pages
  • Use the eso-pic package for watermarking over the images
Slide 3

System Requirements

To record this tutorial, I am using:
  • Linux Mint OS version 21.3
  • Texworks version 0.6.6
Slide 4

Pre-requisites

To follow this tutorial, learners should have basic knowledge of LaTeX.
Slide 5

Code files

The following code files are required to practice this tutorial:

1. draftwatermark-eg.tex

2. Free-Stock-Photos.jpg

The following code files are required to practice this tutorial.

These files are provided in the Code Files link of this tutorial page.

Let us get started.
Highlight:

\usepackage{draftwatermark}

This command imports the draftwatermark package.
Select XeLaTeX typesetting option from the dropdown.

Click the green Typeset button and show the output

Select XeLaTeX and click the green Typeset button to run the code.

Here is the output

Default watermark DRAFT is printed across all the pages

Comment line 7

uncomment line 8

Run the code and show the output

Let us comment line 7 and

uncomment line 8.

Let’s run the code.

The watermark is printed only on the first page.

Comment line 8

uncomment line 7, 12

Run the code

Highlight:

line 12

Comment line 8.

uncomment lines 7 and 12.

Run the code

Watermark Draftcopy is printed across all the pages.

Observe the options given in the \DraftwatermarkOptions command.

Comment line 12

uncomment line 27

Run the code and show the output

Cursor on the text keyword.

Cursor on the changed watermark.

Comment line 12.

uncomment line 27.

Run the code

text keyword in the command changes the watermark text.

Here the watermark changes to Sample.

uncomment line 28

Run the code and show the output

Uncomment line 28 and run the code.

color keyword changes the watermark colour.

Here it changes to blue

We can also use values like [gray]{0.5} or [rgb]{1, 0, 1}.

That is by name and its strength or with the rgb option.

For that we have to load \usepackage{xcolor} in the preamble.

uncomment line 29

Run the code and show the output

Uncomment line 29

Run the code

fontsize keyword changes the watermark’s fontsize.

uncomment line 30

Run the code and show the output

Uncomment line 30.

Run the code

Here is the output.

hpos keyword

changes the horizontal position of the watermark.

uncomment line 31

Run the code and show the output

Uncomment line 31

Run the code

Here is the output.

vpos keyword changes the vertical position of the watermark.

uncomment line 32

Run the code and show the output

Uncomment line 32

Run the code.

angle keyword in the command changes the angle of the watermark

Here it changes to 60 degrees.

uncomment line 33

Run the code and show the output

Uncomment line 33

Run the code

Stamp keyword is set to true or false.

Here false makes the watermark vanish from all the pages.

Comment line 33, 32, 31, 30, 29, 28, 27

uncomment line 34

Run the code and show the output

Highlight:

Highlight lines 27 to 33 and then Highlight line 34.

Highlight the text EduPyramids in the code.

Comment the lines 27 to 33.

Uncomment the line 34

Run the code.

Notice that all the options are given in a single line of code.

Here watermarking text is EduPyramids.

So far, the watermark has only appeared on the pages, but not on top of the image.

Now, let us see how to get the watermark on top of the image too.

Comment the lines 34 and 7 Comment the lines 34 and 7.
Uncomment the lines from 36 to 48 Uncomment the lines from 36 to 48.
Highlight line 36

Highlight lines 37 to 43

Highlight Line 46

In line 36, we load the eso-pic package.

We use this package to get a watermark on top of the images.

In lines 37 to 43 we define a new command called MyWatermark.

This command defines the watermark’s text colour to blue and the text to Confidential.

Line 46 instructs the compiler to ship out every page with the watermark on foreground.

Let’s run the code to see the output.

Cursor on the Output

Let us run the code

Now we see the watermark on the image too.

Watermarking it with blue colour and with the text Confidential.

Slide 6

Summary

In this tutorial, we have learnt to:

  • Create and customize watermarks using the draftwatermark package
  • Control watermark visibility on specific pages
  • Use the eso-pic package for watermarking over the images
With this we come to the end of this tutorial.

Let us summarise.

Slide 7

Assignment

Add a watermark with:

  • Text: PRELIMINARY
  • Color: red
  • Font size: 3cm
  • Angle: 60 degrees
As an Assignment , add a watermark with the following attributes.
Slide 8

Thank you

Thank you for joining.

Contributors and Content Editors

Ketkinaina, Madhurig