Tuesday 22 January 2013

Watermarking in LATEX

  Before uploading documents to the Internet, it is a very good idea to watermark them so that your work is not claimed by others. You can include a watermark to PDF documents by using LATEX. I am discussing two different methods to watermark your PDF documents.

The code given below can be used to add a watermark to your PDF file.

\usepackage{draftwatermark}
\SetWatermarkLightness{ 0.90 }    
% The above Statement sets 
% the transparency of the Watermarking Text.
\SetWatermarkScale{ 15 } 
% The above Statement sets 
% the size of the Watermarking Text.   
\SetWatermarkText{D} 
% The above Statement sets the Watermarking Text.
 
Click here to download the TEX file for adding watermarks to PDF documents. 
Click here to view the PDF document with Watermark.
 
  
If you don't have the package "draftwatermark" in your Latex installation, then use the following code.

\usepackage{graphicx,type1cm,eso-pic,color}
\makeatletter
  \AddToShipoutPicture{              
    \setlength{\@tempdimb}{.5\paperwidth
    \setlength{\@tempdimc}{.5\paperheight}
    \setlength{\unitlength}{1pt}
    \put(\strip@pt\@tempdimb,\strip@pt\@tempdimc){
       \makebox(0,0){
          \rotatebox{55}{  
          % The above Statement sets 
          % the Rotation of the Watermarking Text.                        
           \textcolor[gray]{0.85}{ 
           % The above Statement sets 
           % the transparency of the Watermarking Text.
               \fontsize{5cm}{5cm} 
               % The above Statement sets 
               % the size of the Watermarking Text.
               \selectfont{D}}}}}}  
               % The above Statement sets 
               % the Watermarking Text.
\makeatother

Click here to download the TEX file for adding watermarks to PDF documents. 
Click here to view the PDF document with Watermark. 

No comments:

Post a Comment