HTML generated Microsoft Word document with header, footer and watermark

This is some example, hope it helps others that are trying to generate ms word .doc file with HTML. <html xmlns:v=”urn:schemas-microsoft-com:vml” xmlns:o=”urn:schemas-microsoft-com:office:office” xmlns:w=”urn:schemas-microsoft-com:office:word” xmlns:m=”http://schemas.microsoft.com/office/2004/12/omml” xmlns=”http://www.w3.org/TR/REC-html40″> <head><meta http-equiv=Content-Type content=”text/html; charset=utf-8″><title></title> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <style> @page { mso-page-orientation: landscape; size:29.7cm 21cm; margin:1cm 1cm 1cm 1cm; } @page Section1 { mso-header-margin:.5in; … Read more

Watermarking with PDFBox

UPDATED ANSWER (Better version with easy way to watermark, thanks to the commentators below and @okok who provided input with his answer) If you are using PDFBox 1.8.10 or above, you can add watermark to your PDF document easily with better control over what pages needs to be watermarked. Assuming you have a one page … Read more

How might I add a watermark effect to an image in Android?

I found great tutorial on Android Image Processing here. public static Bitmap mark(Bitmap src, String watermark, Point location, Color color, int alpha, int size, boolean underline) { int w = src.getWidth(); int h = src.getHeight(); Bitmap result = Bitmap.createBitmap(w, h, src.getConfig()); Canvas canvas = new Canvas(result); canvas.drawBitmap(src, 0, 0, null); Paint paint = new Paint(); … Read more

Watermark in System.Windows.Forms.TextBox

lately I needed a watermark textbox, the first thing that popped in to my head was OnLeave and OnEnter events of textbox, but first I googled it and I got two links first was the one in CodeProject which used the System.Drawing namespace and the other one was here using the SendMessage() over here http://vidmar.net/weblog/archive/2008/11/05/watermarked-textbox-in-windows-forms-on-.net.aspx. … Read more

Add ‘Watermark’ to images with php [closed]

A good example in the PHP manual: // Load the stamp and the photo to apply the watermark to $stamp = imagecreatefrompng(‘stamp.png’); $im = imagecreatefromjpeg(‘photo.jpeg’); // Set the margins for the stamp and get the height/width of the stamp image $marge_right = 10; $marge_bottom = 10; $sx = imagesx($stamp); $sy = imagesy($stamp); // Copy the … Read more