Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > General Discussion
  New Posts New Posts RSS Feed - PDF Stamps or WaterMarks
  FAQ FAQ  Forum Search   Register Register  Login Login

PDF Stamps or WaterMarks

 Post Reply Post Reply
Author
Message
jabaltie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 Nov 05
Location: Brazil
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote jabaltie Quote  Post ReplyReply Direct Link To This Post Topic: PDF Stamps or WaterMarks
    Posted: 29 Dec 05 at 5:11AM
I have several PDF templates, which one with its own design. Each one may be elaborated by a different developer. These templates are PDFs with empty form fields.

The process of stuffing data into the fields is centralized by a single program. This program grabs data from XML documents and merge it into the fields. Basically the XML document is a field name/field content relation.

On this program, that does generates the final PDFs, I want to add some sayings to the output PDF. Something like this :

"This document was digitally generated by 'X Institution', on DD/MM/YYYY at HH:MM:SS and has this unique protocol number : 999999".

I dont know which is the best approach to add these sayings to the document. I've thought about :

1) Demand the developers to provide these fields (or sayings) on each and every designed template. I think it would be difficult to keep a standard, however, because each person could do it differently or even worse - dont do it at all.

2) Add some sort of stamp to the generated PDF. I've seen something about stamps on PDFs but I dont know exactly what is it.

3) Use some sort of watermark. Dont know if we can do that with PDFs.

What do you "PDF masters" out there think of it ? What's the best approach ? Is there another one beyond the ones I suggested ?

Thanks in advance 4 your help !
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Online
Points: 3406
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 29 Dec 05 at 5:31AM
Hi!
I'm not a "PDF Master" but ... ;-)
The last program producing the final pdf-file should do this job 'cause then it looks on every pdf in the same way.
It should be a watermark. As transparency value you should set 75 percent - so it doesn't disturb while reading.
You can do this all with QuickPDF. I'm out of office now but i'll send you a code-snippet (in delphi) this evening.
Cheers,
Ingo

Back to Top
jabaltie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 Nov 05
Location: Brazil
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote jabaltie Quote  Post ReplyReply Direct Link To This Post Posted: 29 Dec 05 at 5:42AM
Hi Ingo !

Thank you so much for your support .

Even if you're not that Master you're more Master than I :-)

I do agree that the process should be centralized, to always look the same way.

Can we have a standard placing for the watermark ? I think so...

Should you want to see how a template of ours is , go get one from here :

http://www.online.unimep.br/rps/ag/ag223a.pdf

It is a document that proofs that the student is enrolled to our University.

Thanks again 4 your help !
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Online
Points: 3406
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 29 Dec 05 at 7:31AM
Hi again!

I think the watermark should be placed diagonally in the top right corner. I've much to do but i hope i can send you a working sample this evening ... If not - don't be too angry... i try it ;-)

Cheers,
Ingo

Back to Top
jabaltie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 Nov 05
Location: Brazil
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote jabaltie Quote  Post ReplyReply Direct Link To This Post Posted: 29 Dec 05 at 2:14PM
Hi Ingo !

Have you got my PDF template ? The one I suggested above ?

Maybe we could have several positions for the WaterMark. But let's start with your suggestion anyway and we add positioning later.

On the other hand, how could I be angry with you when you're beeing so kind ?

Once more, thank you so much !

Auf wiedersehn !
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Online
Points: 3406
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 29 Dec 05 at 4:48PM
Hi!
It last a bit to prepare the code for you but here it is...
I've posted it in the sample area at "Watermark...".
I hope it makes your work a bit more easier.
Good luck, happy clicking and the best wishes (to the other readers, too) for 2006!

Cheers,
Ingo

Back to Top
jabaltie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 Nov 05
Location: Brazil
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote jabaltie Quote  Post ReplyReply Direct Link To This Post Posted: 30 Dec 05 at 6:35AM
Hi Ingo

Once more, thank you for your help. However, you're trying to speak German while I'm still trying to understand English !

I managed to simplify a lot your program, rewriting it in VBScript to work as a simple command line one. I think VBScript is a more common designator for us all. As a matter of fact, I'll have to port it later to XBase++ wich is the language I work with here.

Also, to make things even simpler I just want to add the WaterMark on top of the page, at first.

Then, I still need some help with the script below. Cant have it centralizing the text on the page...

OPTION EXPLICIT

DIM objMyForm,nReturn,nCount,nI,fName,fValue,poptions,atf,ts,tl,Text,xPos,yPos

Set objMyForm = WScript.CreateObject("ISED.QUICKPDF")

Text="I'm Mr WaterMark !"

WScript.Echo "UnlockKey" ,objMyForm.unlockkey("mykey")
WScript.Echo "LoadFile " ,objMyForm.LoadFromFile("TEST.PDF")
WScript.Echo "Origin   " ,objMyForm.SetOrigin(1)
WScript.Echo "Units    " ,objMyForm.SetMeasurementUnits(0) 'means pixel
WScript.Echo "paginas " ,objMyForm.PageCount
WScript.Echo "sel page " ,objMyForm.SelectPage(1)
WScript.Echo "unencript" ,objMyForm.Unencrypt
WScript.Echo "add font " ,atf = objMyForm.AddTrueTypeFont("Arial [Bold] {850}", 1) ' Font Arial Bold ... But not embedded !
WScript.Echo "sel font " ,objMyForm.SelectFont(atf)
WScript.Echo "page heig" ,objMyForm.PageHeight
WScript.Echo "pag width" ,objMyForm.PageWidth
ts=18
WScript.Echo "set txtsz" ,objMyForm.SetTextSize(18)
WScript.Echo "set trans" ,objMyForm.SetTransparency(50)

xPos=(objMyForm.PageWidth - ts) \ 2 - ts
yPos=objMyForm.PageHeight-10
yPos=20

WScript.Echo "xPos     " ,xPos
WScript.Echo "yPos     " ,yPos

WScript.Echo "draw     ",objMyForm.DrawRotatedText(xPos,yPos,0,Text)
WScript.Echo "save     ",objMyForm.SaveToFile("C:\TEMP\TEST.PDF")

I'm using this PDF :

http://www.DES.online.unimep.br/rps/ag/ag223a.pdf
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Online
Points: 3406
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 30 Dec 05 at 9:16AM
Hi!
Centralizing isn't a problem.
You need the pagewidth and -height,
The textlength and fontsize...
and then you have to do some maths... pagewidth div 2 and so on...
Cheers,
Ingo

Back to Top
jabaltie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 Nov 05
Location: Brazil
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote jabaltie Quote  Post ReplyReply Direct Link To This Post Posted: 30 Dec 05 at 11:00AM
Hi Ingo

Sure, centralizing is a piece of cake ! I managed to get it working based on your hints (script at end).

Now I'm still having problems with Adding Font. Dont know why it doesnt work...

Would it maybe be because the PDF file already has Arial ?

-------------------------------------------------------

OPTION EXPLICIT

DIM objMyForm,nReturn,nCount,nI,fName,fValue,poptions,atf,ts,tl,Text,xPos,yPos

Set objMyForm = WScript.CreateObject("ISED.QUICKPDF")

WScript.Echo "UnlockKey" ,objMyForm.unlockkey("mykey")
WScript.Echo "LoadFile " ,objMyForm.LoadFromFile("TEST.PDF")
WScript.Echo "Origin   " ,objMyForm.SetOrigin(1)
WScript.Echo "Units    " ,objMyForm.SetMeasurementUnits(0) 'means pixel
WScript.Echo "paginas " ,objMyForm.PageCount
WScript.Echo "sel page " ,objMyForm.SelectPage(1)
WScript.Echo "unencript" ,objMyForm.Unencrypt
WScript.Echo "add font " ,atf = objMyForm.AddTrueTypeFont("Arial [Bold] {850}", 1) ' Font Arial Bold ... But not embedded !
WScript.Echo "sel font " ,objMyForm.SelectFont(atf)
WScript.Echo "set trans" ,objMyForm.SetTransparency(50)

Text="I'm Mr WaterMark !"

xPos=(objMyForm.PageWidth - objMyForm.GetTextWidth(Text)) \ 2
yPos=objMyForm.PageHeight-10
'yPos=20

WScript.Echo "draw     ",objMyForm.DrawRotatedText(xPos,yPos,0,Text)
WScript.Echo "save     ",objMyForm.SaveToFile("C:\TEMP\TEST.PDF")
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store