Adam , This post is old, but I am still facing problems using the watermark, and I need it badly.
I have created a Microsoft word doc file with a watermark and I saved it as a PDF file, and it appears just as I want. Now I am looking for a way for how to do this with PDFBox. You can check this 1 page sample PDF : http://www.4shared.com/document/rQ2berMh/pdf_with_watermark.html Any help would be appreciated. Best regards , Hesham --------------------------------------------- Included message : > Sorry, but I can't give you any code examples for I have never done any > work with stamps nor watermarks. All I did was read the manual because > when I saw your question I thought "Hmm, that's a good question!" > > What you describe sounds correct in terms of how it works, but it looks > like there is also an option to have the watermark not appear at all on > the PDF (when rendered on the screen), but appear when it is printed. I'm > not sure if that's something you are interested in, but it's an option as > far as I can tell. > > Your best bet would be to find a PDF with a watermark, then extract a > single page. This will give you a small PDF with a watermark and you > should be able to go through it by hand (i.e. a good text editor). Just > search for "watermark" and see what comes up and then when you find > something in the PDF, see what references it and check the spec to get > some more information about what you're looking at. For example, if you > see object "72 0" is a watermark, search for things which reference 72 0. > If you keep doing this you'll eventually get back to the root. If you > keep notes, you should have a nice map of how everything is connected. > I've done this for other objects and in combination with the spec, it's > worked out pretty well. Remember, you can also make modifications to the > PDF using a text editor to see what it does (just remember to back up the > original before you go hacking up the PDF or you'll probably end up with a > corrupt document). > > ---- > Thanks, > Adam > > > > From: > "Hesham G." <[email protected]> > To: > <[email protected]> > Date: > 11/11/2010 03:15 > Subject: > Re: Is there a difference between Watermark & Stamp ? > > > > Adam , > > Thanks a lot for you reply, and sorry for being that late ... You're > always > here Adam when I need an answer. > > I have this in PDF reference 1.7, but I do not understand that Adobe code > :) > If you can translate this to me or give me a PDFBox code example, that > will > be very helpful. > > In general, what I understand is that both watermarks and stamps both can > be > images that appear in the PDF, but a watermark will appear in the > background, so if there was a text above it, the text will appear > normally. > In addition a watermark will appear as a part of the page, so it can't be > clicked to show a notice box, as happens in a Stamp. > > If this is wrong I hope you can correct me. if it's right, then watermarks > > is what I am looking for. > > Best regards , > Hesham > > --------------------------------------------- > Included message : > >> Hesham, >> >> Take a look at table 102 in section 8.11.4.4 (Usage and Usage > Application >> Dictionaries) of the PDF spec (I'm looking at version 1.7). >> "A dictionary specifying that the content in this group is shall be used >> when printing. It may contain the following optional entries: >> Subtype A name object specifying the kind of content controlled by the >> group; for example, Trapping, PrintersMarks and Watermark. >> PrintState A name that shall be either ON or OFF, indicating that the >> group shall be set to that state when the document is printed from a >> conforming reader." >> >> For more information on the subtypes, see section 12.5.6.1, and > 12.5.6.22 >> for specific details about a watermark. >> >> I didn't read all the sections I just references, but after a quick > look, >> it seems the main difference is that watermarks only appear on printed >> documents, where images would appear when viewing the document as well. >> PDFBox might already support watermarks, but if it doesn't it could >> probably be added without too much difficulty. Section 12.5.6.22 has a >> nice example of how it's laid out in the PDF which you could reference. >> You could also use that to either verify that your test document > actually >> has a real watermark, or to manually add a watermark to one of your test >> documents. >> >> ---- >> Thanks, >> Adam >> >> >> ----- Forwarded by Adam Nichols/UR/CER/XLDynamics on 11/09/2010 12:04 >> ----- >> >> From: >> Adam Nichols/UR/CER/XLDynamics >> To: >> [email protected] >> Cc: >> "pdfbox-send-question" <[email protected]> >> Date: >> 11/08/2010 09:13 >> Subject: >> Re: Is there a difference between Watermark & Stamp ? >> >> >> Take a look at table 102 in section 8.11.4.4 (Usage and Usage > Application >> Dictionaries) of the PDF spec (I'm looking at version 1.7). >> "A dictionary specifying that the content in this group is shall be used >> when printing. It may contain the following optional entries: >> Subtype A name object specifying the kind of content controlled by the >> group; for example, Trapping, PrintersMarks and Watermark. >> PrintState A name that shall be either ON or OFF, indicating that the >> group shall be set to that state when the document is printed from a >> conforming reader." >> >> For more information on the subtypes, see section 12.5.6.1, and > 12.5.6.22 >> for specific details about a watermark. >> >> I didn't read all the sections I just references, but after a quick > look, >> it seems the main difference is that watermarks only appear on printed >> documents, where images would appear when viewing the document as well. >> PDFBox might already support watermarks, but if it doesn't it could >> probably be added without too much difficulty. Section 12.5.6.22 has a >> nice example of how it's laid out in the PDF which you could reference. >> You could also use that to either verify that your test document > actually >> has a real watermark, or to manually add a watermark to one of your test >> documents. >> >> ---- >> Thanks, >> Adam >> >> >> >> From: >> "Hesham G." <[email protected]> >> To: >> "pdfbox-send-question" <[email protected]> >> Date: >> 11/07/2010 00:53 >> Subject: >> Is there a difference between Watermark & Stamp ? >> >> >> >> Hello everyone , >> >> What is the difference between a watermark and a stamp in PDF ? >> I have seen nice examples in PDFBox to create stamps, but none to create >> watermarks. I guess it is not supported yet ! >> >> >> Best regards , >> Hesham >> >> >> >> >> >> - FHA 203b; 203k; HECM; VA; USDA; Conventional >> - Warehouse Lines; FHA-Authorized Originators >> - Lending and Servicing in over 45 States >> www.swmc.com - www.simplehecmcalculator.com >> Visit www.swmc.com/resources for helpful links on Training, Webinars, > >> Lender Alerts and Submitting Conditions >> >> This email and any content within or attached hereto from Sun West >> Mortgage Company, Inc. is confidential and/or legally privileged. The >> information is intended only for the use of the individual or entity > named >> on this email. If you are not the intended recipient, you are hereby >> notified that any disclosure, copying, distribution or taking any action > >> in reliance on the contents of this email information is strictly >> prohibited, and that the documents should be returned to this office >> immediately by email. Receipt by anyone other than the intended > recipient >> is not a waiver of any privilege. Please do not include your social >> security number, account number, or any other personal or financial >> information in the content of the email. Should you have any questions, >> please call (800) 453 7884. = > > > > > > > - FHA 203b; 203k; HECM; VA; USDA; Conventional > - Warehouse Lines; FHA-Authorized Originators > - Lending and Servicing in over 45 States > www.swmc.com - www.simplehecmcalculator.com > Visit www.swmc.com/resources for helpful links on Training, Webinars, > Lender Alerts and Submitting Conditions > > This email and any content within or attached hereto from Sun West Mortgage > Company, Inc. is confidential and/or legally privileged. The information is > intended only for the use of the individual or entity named on this email. If > you are not the intended recipient, you are hereby notified that any > disclosure, copying, distribution or taking any action in reliance on the > contents of this email information is strictly prohibited, and that the > documents should be returned to this office immediately by email. Receipt by > anyone other than the intended recipient is not a waiver of any privilege. > Please do not include your social security number, account number, or any > other personal or financial information in the content of the email. Should > you have any questions, please call (800) 453 7884. =

