How do I generate a pdf file with transparent background

  • Follow


Dear All,
I need to generate a pdf file wtih transparent background using LaTeX.

I am trying to generate a pdf file (say back.pdf) with a watermark at
the middle and (scanned) signature at the bottom. Then I will want to
put this back.pdf on another multipage pdf file using pdftk. The
problem is, when I use stamp option with pdftk, the watermark in the
middle covers the original text, when I use background option, the
watermark is not displayed.

Here is my back.tex

\documentclass{article}

\usepackage[a4paper,dvips,left=25.0mm,top=15.0mm,bottom=7.50mm,right=15.0mm]
{geometry}

\usepackage{times}

\raggedright

\usepackage{xwatermark}

\usepackage{pgf}

\usepackage{xcolor}

\begin{document}

\pagestyle{empty}

\watermarksetup{allpages=true,
  angle=45,scale=0.375,
  color=pink,
  textmark=\makebox[0.75\textwidth][c]{\sffamily\mdseries Processed @
CSE, BUET},
  align=center,
  xcoord=0,ycoord=0
}

\vspace*{0.0mm}
\vfill

\pgfimage[width=0.2\textwidth]{mmamkinitial.png}\hfill

\end{document}

The png file at the end is a simple png file containing scanned
signatures.


I generate the back pdf using pdflatex.

Then for pdftk,

pdftk  in.pdf background back.pdf output out.pdf

covers text in in.pdf

pdftk  in.pdf stamp back.pdf output out.pdf

does not display the watermark at center, the signature at bottom is
correctly displayed.

The only solution will be to make back.pdf transparent. How do I do
that?

Any other suggestion will be appreciated.

Thanks in advance.
0
Reply mmasroorali69 (82) 3/1/2010 10:33:34 AM

On Mar 1, 5:33=A0am, MMasroorAli <mmasroor...@cse.buet.ac.bd> wrote:
> Dear All,
> I need to generate a pdf file wtih transparent background using LaTeX.
>
> I am trying to generate a pdf file (say back.pdf) with a watermark at
> the middle and (scanned) signature at the bottom. Then I will want to
> put this back.pdf on another multipage pdf file using pdftk. The
> problem is, when I use stamp option with pdftk, the watermark in the
> middle covers the original text, when I use background option, the
> watermark is not displayed.
>
> Here is my back.tex
>
> \documentclass{article}
>
> \usepackage[a4paper,dvips,left=3D25.0mm,top=3D15.0mm,bottom=3D7.50mm,righ=
t=3D15.0mm ]
> {geometry}
>
> \usepackage{times}
>
> \raggedright
>
> \usepackage{xwatermark}
>
> \usepackage{pgf}
>
> \usepackage{xcolor}
>
> \begin{document}
>
> \pagestyle{empty}
>
> \watermarksetup{allpages=3Dtrue,
> =A0 angle=3D45,scale=3D0.375,
> =A0 color=3Dpink,
> =A0 textmark=3D\makebox[0.75\textwidth][c]{\sffamily\mdseries Processed @
> CSE, BUET},
> =A0 align=3Dcenter,
> =A0 xcoord=3D0,ycoord=3D0
>
> }
>
> \vspace*{0.0mm}
> \vfill
>
> \pgfimage[width=3D0.2\textwidth]{mmamkinitial.png}\hfill
>
> \end{document}
>
> The png file at the end is a simple png file containing scanned
> signatures.
>
> I generate the back pdf using pdflatex.
>
> Then for pdftk,
>
> pdftk =A0in.pdf background back.pdf output out.pdf
>
> covers text in in.pdf
>
> pdftk =A0in.pdf stamp back.pdf output out.pdf
>
> does not display the watermark at center, the signature at bottom is
> correctly displayed.
>
> The only solution will be to make back.pdf transparent. How do I do
> that?
>
> Any other suggestion will be appreciated.
>
> Thanks in advance.

I don't know the answer to your question, but you could achieve the
desired effect using the pdfpages package, albeit that you're then
compiling a latex document for each pdf file you'd like watermarked.
0
Reply Joris 3/1/2010 1:04:19 PM


On 1 Mrz., 05:33, MMasroorAli <mmasroor...@cse.buet.ac.bd> wrote:
> Dear All,
> I need to generate a pdf file wtih transparent background using LaTeX.
>
> I am trying to generate a pdf file (say back.pdf) with a watermark at
> the middle and (scanned) signature at the bottom. Then I will want to
> put this back.pdf on another multipage pdf file using pdftk. The
> problem is, when I use stamp option with pdftk, the watermark in the
> middle covers the original text, when I use background option, the
> watermark is not displayed.
>
> Here is my back.tex
>
> \documentclass{article}
>
> \usepackage[a4paper,dvips,left=3D25.0mm,top=3D15.0mm,bottom=3D7.50mm,righ=
t=3D15.0mm]
> {geometry}
>
> \usepackage{times}
>
> \raggedright
>
> \usepackage{xwatermark}
>
> \usepackage{pgf}
>
> \usepackage{xcolor}
>
> \begin{document}
>
> \pagestyle{empty}
>
> \watermarksetup{allpages=3Dtrue,
> =A0 angle=3D45,scale=3D0.375,
> =A0 color=3Dpink,
> =A0 textmark=3D\makebox[0.75\textwidth][c]{\sffamily\mdseries Processed @
> CSE, BUET},
> =A0 align=3Dcenter,
> =A0 xcoord=3D0,ycoord=3D0
>
> }
>
> \vspace*{0.0mm}
> \vfill
>
> \pgfimage[width=3D0.2\textwidth]{mmamkinitial.png}\hfill
>
> \end{document}
>
> The png file at the end is a simple png file containing scanned
> signatures.
>
> I generate the back pdf using pdflatex.
>
> Then for pdftk,
>
> pdftk =A0in.pdf background back.pdf output out.pdf
>
> covers text in in.pdf
>
> pdftk =A0in.pdf stamp back.pdf output out.pdf
>
> does not display the watermark at center, the signature at bottom is
> correctly displayed.
>
> The only solution will be to make back.pdf transparent. How do I do
> that?
>
> Any other suggestion will be appreciated.
>
> Thanks in advance.

What about using the eso-pic package

I used in some document I have:

\newcommand\BackgroundPicture{%
     \parbox[b][\paperheight]{\paperwidth}{%
       \vfill
       \centering
       \includegraphics[width=3D0.6\paperwidth,height=3D0.6\paperheight,%
                        keepaspectratio]{unal_logo/unallogo} %Logo de
la universidad
       \vfill
     }}

% Just make a \fbox around the graphic and measure how much should you
put here
% Remember to calculate the correct bounding box "ps2eps unallogo.ps"
\AddToShipoutPicture{\put(14,0){\BackgroundPicture}}


HERE IS YOUR TEXT...

AND THEN..

\ClearShipoutPicture
0
Reply Diego 3/2/2010 4:19:59 PM

2 Replies
1439 Views

(page loaded in 0.368 seconds)

Similiar Articles:













7/23/2012 8:50:03 AM


Reply: