Giter Site home page Giter Site logo

Comments (8)

callegar avatar callegar commented on July 4, 2024

Draftwatermark by current standards has many limitations. One of them is that you cannot fine control the "depth" where the watermark is placed.
Fixing this issue would require a thorough rewrite of the code, that unfortuntately cannot be on my radar due to lack of time.
My suggestion is to use Koma script scrlayer to achieve the desired goals in all cases where draftwatermark is currently insufficient.

from latex-draftwatermark.

callegar avatar callegar commented on July 4, 2024

Can you please provide a little testcase? I am currently updating the draftwatermark package and if possible I would like to take the occasion to look into this matter.

from latex-draftwatermark.

callegar avatar callegar commented on July 4, 2024

A new version of draftwatermark is out (release 3.0). On new LaTeX formats (Autumn 2020) it uses a different mechanism to put the watermark on the page. This should assure that the watermark is actually always on the background. If you have a new enough LaTeX system, can you give it a try and report back?

from latex-draftwatermark.

jamesg-mit avatar jamesg-mit commented on July 4, 2024

Hi Sergio, Thank you very much for your contributions and the draftwatermark package.

I believe I have a reasonable MWE test case that shows the issue when pdfpages is used with draftwatermark. Here the watermark is placed on top of the included PDF but behind other files.

MWE tex file

\documentclass[]{article}

%Packages 
\usepackage{pdfpages}
\usepackage[stamp,color=red!10]{draftwatermark}
\usepackage{lipsum}
\usepackage[T1]{fontenc} % use T1 encoded fonts in output -- 256 glyphs vs. 128, also <> symbols work
\usepackage[utf8]{inputenc} % allow for utf8 encoding in the .tex files
\usepackage{lmodern} % use latin modern font (updated replacement vs. cm), have to load AFTER fontenc

\begin{document}
\textbf{Watermark is under the text}
\lipsum[1-3]
\textbf{In the following page, the watermark is over the inserted PDF:}
\clearpage

\includepdf[pages={1-},		    %Select pages from 3 onward to end
	scale=0.86,					%Tweak scale to fit within margin of output. 0.86 is max to fit
	trim=1in 1in 1in 1in, clip, %[left bot right top]: Clip off margins of source doc, 1" margins
	landscape=false, angle=0,   %don't use landscape or rotate
	frame=true,                 %add frame (may be turned off)
	pagecommand={}]             %Needed to prevent empty page format (which deletes template headers/footers)
	{test_include.pdf}   %Included file
\end{document}

Test PDF to include
test_include.pdf

Resulting PDF
watermark_example.pdf
Build info:

pdfTeX, Version 3.141592653-2.6-1.40.23 (MiKTeX 21.10) (preloaded format=pdflatex 2021.10.12)
pdfpages.sty    2021/03/06 v0.5t Insert pages of external PDF documents (AM)
draftwatermark.sty    2020/12/08 3.0 Put a gray textual watermark on document pages```

from latex-draftwatermark.

dseddah avatar dseddah commented on July 4, 2024

Hi, thanks for this very cool package.
It would very cool to have an option to make sure that the watermark would be on top of everything. For example, i'm having imported graphs as pdf images through includegraphics and the watermark is below the image but above the text :(

from latex-draftwatermark.

callegar avatar callegar commented on July 4, 2024

@jamesg-mit

With a long delay, a fix/workaround is in the works.

In case you are interested in som inner details, I hoped that pdfpages would have moved to use the new LaTeX hooks framework directly rather than depending on eso-pic which could have enabled a more robust solution to the problem. As is, it is unclear to me if placing a workaround in draftwatermark could break something else depending on eso-pic.

As a temporary workaround for your case, please try adding

\DeclareHookRule {shipout/background}{draftwatermark}{<}{eso-pic}

before \begin{document}

from latex-draftwatermark.

callegar avatar callegar commented on July 4, 2024

Workaround is in R3.3

from latex-draftwatermark.

jamesg-mit avatar jamesg-mit commented on July 4, 2024

@callegar I really would like to thank you. The new package and work around work great for my application.

I also noticed that I can flip the less-than to greater-than operator to force the watermark on top and thought that was pretty neat.

from latex-draftwatermark.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.