This series is written by a representative of the latter group, which is comprised mostly of what might be called "productivity users" (perhaps "tinkerly productivity users?"). Though my lack of training precludes me from writing code or improving anyone else's, I can, nonetheless, try and figure out creative ways of utilizing open source programs. And again, because of my lack of expertise, though I may be capable of deploying open source programs in creative ways, my modest technical acumen hinders me from utilizing those programs in what may be the most optimal ways. The open-source character, then, of this series, consists in my presentation to the community of open source users and programmers of my own crude and halting attempts at accomplishing computing tasks, in the hope that those who are more knowledgeable than me can offer advice, alternatives, and corrections. The desired end result is the discovery, through a communal process, of optimal and/or alternate ways of accomplishing the sorts of tasks that I and other open source productivity users need to perform.
Showing posts with label watermark. Show all posts
Showing posts with label watermark. Show all posts

Friday, April 17, 2015

Addendum to 12th installment: watermarks with copyright notice using LaTeX

So, it's been awhile. And there's been plenty I could have blogged about on the tech front. Like when I copied my Arch install to another hard drive, making it bootable. But I didn't. And now I've forgotten important details of how I did it. Oh well.

I can blog about this next item, though, which is still fresh in memory. I've got to write up  some articles and am sending them out for proofreading. So I wanted to mark them as drafts, something I already know how to do and have blogged about previously.

I decided to modify things a bit for the current task, though. This time I'm using only one utility to do the watermarking--LaTeX--and I'm tweaking things a bit further.

The challenge this time is making a watermark with a line break, as well as one that contains text with differing font sizes in the two lines. I want a really large font for the first line, which marks the document as a draft--as in my previous installment--but I want a really small font for the second line this time. That second line is where a copyright notice will be located.

Without further ado, here's the MWE (TeX-speak for minimum working example) I've come up with for accomplishing this:



This will place, diagonally across each page of the document, a notice in light gray font and in very large letters, with the word DRAFT. Underneath that, there will be text in much smaller font alerting that the material is under copyright claim of the document's author. It's also got a nice little feature that auto-inserts the year, so it's something that can be reused in varying documents over a period of time, relieving the composer of having to fiddle with minor details like dates.

So, that's about it for this installment!

LATE ADDITION: Just today I ran across a new means of watermarking that can be done on already-existing .pdf files. It involves using the program pdftk and is quite simple. You simply create an empty--except for your desired watermark--.pdf, then use the program to add the watermark to the already-existing .pdf. Something like the following:

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

(I ran across that here). I used LibreOffice Draw to create such a background watermark and easily added that to an existing .pdf. It worked great, though it should be noted that the watermark won't cover graphics; I assume there must be a way to make it do so, however.

Wednesday, October 30, 2013

12th installment: adding watermarks to documents

In this twelfth installment, I'll describe my recent success with adding watermarks to a document. As often happens when I want to do a quick document or need to work on a .doc file, I turned to LibreOffice for this task. The major part of this post, then, will be occupied with how to add watermarks to documents created in or edited with LibreOffice/OpenOffice. I decided, just out of curiosity, to look into how watermarks can be added to TeX/LaTeX documents as well, so I'll share as well a bit of information that I gleaned about that from another site.

First, though, a bit about watermarks. As the wikipedia article on the topic tells us "[a] watermark is a recognizable image or pattern in paper that appears as various shades of lightness/darkness when viewed by transmitted light (or when viewed by reflected light, atop a dark background), caused by thickness or density variations in the paper."

Watermarks proper are actually added into the paper itself during manufacture, and the text was later printed over the watermark. With the advent of modern computer printing, however, it has become possible to print "watermarks"--actually it might be better to refer to these as pseudo-watermarks--onto standard, clean paper and so to add them, page by page, to a document. This is the sort of watermarking I will be discussing.

This pseudo-watermarking might be added to a document for a number of reasons: a background image--such as a business logo--might be wanted in a document; a copyright notice might be added to a document in this way; or a document might need to be identified as a draft, as opposed to a final revision. The latter of these scenarios applied to me and was why I wanted to learn how to do pseudo-watermarking.

I was pretty certain I could readily find instructions for how this is done using LibreOffice, and a quick search proved my supposition correct. That search furthermore proved that it is a fairly trivial task, so long as one feels comfortable with using some image editing or creating software. I used GIMP for creating my image, though I decided as well to experiment with LibreOffice Draw and had success with it as well. The image created is simply selected as a background for the document. The steps I used were as follows.

First, open GIMP and select File > New. In the resulting dialog, I changed the increments for image size to inches, so as to create an image that will fit within an 8.5x11 inch sheet.

Once I'd selected the size I wanted and created the file, I next went to the GIMP toolbar and selected the Text Tool. I printed in the resulting window the text I wanted to appear, selected a light gray color for the font, changed the font increment to point, then increased the font size substantially (as you'll see in the screenshot, I went with 213 point type).
The somewhat tricky part after having done that was to rotate the text such that it would run across the page at an angle. This I accomplished by selecting Layer > Transform > Arbitrary Rotation. Doing this raises a window with a slider that allows you to rotate the image to the desired angle--in my case -57.66 degrees. As will be evident in the screenshot, the text can be better centered in the image using this dialog as well (x and y axes).

Thus, the final product (not very well centered here):
I exported that image to a .png file as the final step. From here, it's a simple matter of opening your LibreOffice document and clicking on Format > Page, selecting the "Background" tab, selecting "Graphic" from the "As" drop-down menu, and finding and selecting the file you just created using GIMP. Once that's done, all pages in that file will have a pseudo-watermark with the text "Draft" on them.

The initial video I found described making the watermark using LibreOffice's Draw program, so I decided I should have a try with it as well. That process was almost as simple as GIMP's, but it had the limitation that the largest font size I could select was 96 point--a bit on the small side. I will nonetheless outline the steps here.

First, I opened up Draw and selected the "T" (for text insertion) from the toolbar at the bottom of the page.
Next, I selected a light gray font color and the largest possible font size from the menu, and printed the text "Draft" in the page. The text ends up being in a horizontal orientation, of course, as can be seen in the screenshot.
In order to make the text run at an angle across the page, it is next necessary to choose the "Effects" tool from the bottom toolbar (the symbol has two blue boxes off kilter from one another and is situated fourth from the right side on my toolbar). Once that's done the highlights of the text box just created turn red, and if the cursor is moved over the top right corner of that text box, the box can be dragged such that it is oriented on the page at the desired angle.
Once the text box is satisfactorily oriented and centered, the file can be exported. Once again, I chose the .png format. The resulting image can then be added to the background of a document using the same process followed above to add the GIMP image.

Finally, though I did not try out this last method, I wanted to see how difficult or easy it might be, using TeX/LaTex, to add a pseudo-watermark to a document. I easily found some directions here. That author describes three different methods, the simplest of which--since it is one on which pdflatex can be run directly, is quite easy with use of the graphicx, eso-pic, and type1cm packages, as demonstrated in the code below:


Here's how the resulting page looks:


That's it for this installment.