Watermark

389 views
Skip to first unread message

sagar priyadarshi

unread,
Jun 6, 2011, 2:39:34 AM6/6/11
to JODConverter
Dear all.

I am successfully using JODConverter and very happy with the
performance of it.
In a further step, I want watermark (or pdf stamp) to be there on each
page of pdf generated.

Seems that it is not possible through OpenOffice and hence not
possible through JODConverter.
Let me know If I am mistaken.

Is there any other way to meet my requirement.
Of course I am looking some tools/libraries from open source.

I found itext meeting my requirement but that does not come free and I
am not willing to use trial version

Richard Gathogo

unread,
Jun 6, 2011, 3:06:01 AM6/6/11
to jodcon...@googlegroups.com
Hi Sagar,
To watermark or stamp, a good opensource solution is pdfbox and u can use Overlay to do your stamping. Please check it out at pdfbox.org.
Regards Richard Gathogo.


--
You received this message because you are subscribed to the Google Groups "JODConverter" group.
To post to this group, send email to jodcon...@googlegroups.com.
To unsubscribe from this group, send email to jodconverter...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jodconverter?hl=en.




--
+4521843194
Java Developer,
Skype: muraguri2005


sagar priyadarshi

unread,
Jun 8, 2011, 2:48:36 AM6/8/11
to JODConverter
Hi Richard
Thanks for the reply
I tried downloading the same (pdfbox-1.5.0.jar) and tried running in
on terminal
But I am getting error as

"Failed to load Main-Class manifest attribute from
pdfbox-1.5.0.jar"

Am i using the correct jar file? Or is there any other problem?
> *+254752847158*
> ***+4521843194
> ** Java Developer*,* *
> * Skype: muraguri2005*

Richard Gathogo

unread,
Jun 8, 2011, 4:05:01 AM6/8/11
to jodcon...@googlegroups.com
Hi Sagar,
I have never used it on command line. Most of the times I use it in a Java program code. Please send me the command you are trying to run and let me see how I can help.
Regards Richard Gathogo.

sagar priyadarshi

unread,
Jun 8, 2011, 4:08:57 AM6/8/11
to JODConverter
Hi Richard

below command is mentioned on the pdfbox.org
java -jar pdfbox-app-x.y.z.jar Overlay <overlay.pdf> <document.pdf>
<result.pdf>

though i wrote
java -jar pdfbox-1.5.0.jar Overlay <overlay.pdf> <document.pdf>
<result.pdf>

As I am unable to find pdfbox-app-x.y.z.jar.



On Jun 8, 1:05 pm, Richard Gathogo <muraguri2...@gmail.com> wrote:
> Hi Sagar,

Richard Gathogo

unread,
Jun 8, 2011, 4:35:16 AM6/8/11
to jodcon...@googlegroups.com
Hi Sagar,
The downlaod links for pdfbox-app-x.y.z.jar are here http://www.apache.org/dyn/closer.cgi/pdfbox/1.5.0/pdfbox-app-1.5.0.jar You can select your appropriate mirror. Download that and use it, then tell me what happens.
Regards Richard Gathogo.

sagar priyadarshi

unread,
Jun 8, 2011, 5:59:19 AM6/8/11
to JODConverter
Hi Richard

I tried with pdfbox-app-1.5.0 and pdfbox-app-1.3.1 but I am getting
the following error


Exception in thread "main" java.lang.UnsupportedClassVersionError: org/
apache/pdfbox/PDFBox (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:509)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:
123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:
246)
at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
322)


Thanks

On Jun 8, 1:35 pm, Richard Gathogo <muraguri2...@gmail.com> wrote:
> Hi Sagar,

Richard Gathogo

unread,
Jun 8, 2011, 3:18:55 PM6/8/11
to jodcon...@googlegroups.com
Hi Sagar,
Sorry, my day got a bit busy. I will try it out tomorrow then I will give you a feedback.
Regards Richard Gathogo.

sagar priyadarshi

unread,
Jun 8, 2011, 11:25:14 PM6/8/11
to JODConverter
Thnx.
I will wait for the solution

On Jun 9, 12:18 am, Richard Gathogo <muraguri2...@gmail.com> wrote:
> Hi Sagar,

Richard Gathogo

unread,
Jun 9, 2011, 6:40:19 AM6/9/11
to jodcon...@googlegroups.com
Hi Sagar,
It works from this side. I am running Ubuntu 10.10. What about you? This is the command I ran. "java -jar pdfbox-app-1.5.0.jar Overlay VB\ document.pdf root.pdf result.pdf" Where "VB Document.pdf" is the document I want to stamp with "root.pdf", "result.pdf" is the resulting stamped document. If you are doing this on windows you have to make sure that the java path has been set because this could be the problem.
Regards Richard Gathogo.

sagar priyadarshi

unread,
Jun 9, 2011, 6:51:36 AM6/9/11
to JODConverter
And at the same time, can you let me know how to use overlay feature
in java program using pdfbox?
Even that will solve my problem.

Thanks

On Jun 9, 8:25 am, sagar priyadarshi <sagar.shivam2...@gmail.com>
wrote:

Richard Gathogo

unread,
Jun 9, 2011, 6:57:37 AM6/9/11
to jodcon...@googlegroups.com
Hi,
That is very great. That is now the area I am better at. I will send you a code to show you how it is done. Which Java IDE are you comfortable with?
Regards Richard Gathogo.

sagar priyadarshi

unread,
Jun 9, 2011, 11:51:19 PM6/9/11
to JODConverter
Hi Richard
Thanks for continuous replies.

I am using Netbeans6.9.1. Kindly let me know how to write java code
for overlay features

Richard Gathogo

unread,
Jun 10, 2011, 5:09:07 AM6/10/11
to jodcon...@googlegroups.com
Hi Sagar,
You are welcome. I have a attached a project in netbeans to demonstrate the pdfbox overlay functionality in Java.  Gmail  cannot allow me to send the project with it's dependencies and since I would like this to benefit many people I will don't want to deviate from the forum. Download commons-logging-1.1.1.jar, fontbox-1.4.0.jar and pdfbox-1.4.0.jar and add to the lib directory inside the project before running it. Feel free to ask any question in case of any issue that you may encounter.
Regards Richard Gathogo

On Fri, Jun 10, 2011 at 12:01 PM, Richard Gathogo <muragu...@gmail.com> wrote:
Hi Sagar,
You are welcome. I have a attached a project in netbeans to demonstrate the pdfbox overlay functionality in Java. All the required dependancies are also inside the lib directory. Feel free to ask any question in case of any issue that you may encounter.
Regards Richard Gathogo.
+4521843194
Java Developer,
Skype: muraguri2005

createpdfoverlay.zip
Reply all
Reply to author
Forward
0 new messages