|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lowagie.toolbox.AbstractTool
com.lowagie.toolbox.plugins.Watermarker
public class Watermarker
This tool lets you add a text watermark to all pages of a document.
Field Summary | |
---|---|
(package private) FileArgument |
destfile
|
Fields inherited from class com.lowagie.toolbox.AbstractTool |
---|
arguments, internalFrame, MENU_EXECUTE, MENU_EXECUTE_PRINT, MENU_EXECUTE_PRINT_SILENT, MENU_EXECUTE_SHOW, menuoptions, versionsarray |
Constructor Summary | |
---|---|
Watermarker()
This tool lets you add a text watermark to all pages of a document. |
Method Summary | |
---|---|
protected void |
createFrame()
Creates the internal frame. |
void |
execute()
Executes the tool (in most cases this generates a PDF file). |
protected File |
getDestPathPDF()
Gets the PDF file that should be generated (or null if the output isn't a PDF file). |
static void |
main(String[] args)
This methods helps you running this tool as a standalone application. |
void |
valueHasChanged(AbstractArgument arg)
Indicates that the value of an argument has changed. |
Methods inherited from class com.lowagie.toolbox.AbstractTool |
---|
actionPerformed, addVersion, getArguments, getInternalFrame, getMenubar, getUsage, getValue, setArguments, setInternalFrame, setMainArguments, setMenubar |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
FileArgument destfile
Constructor Detail |
---|
public Watermarker()
Method Detail |
---|
protected void createFrame()
createFrame
in class AbstractTool
public void execute()
execute
in class AbstractTool
protected File getDestPathPDF() throws InstantiationException
getDestPathPDF
in class AbstractTool
InstantiationException
public void valueHasChanged(AbstractArgument arg)
valueHasChanged
in class AbstractTool
arg
- the argument that has changedpublic static void main(String[] args)
Call it like this from command line: java com.lowagie.tools.plugins.Watermarker input.pdf Draft 230 0.2 output.pdf
"input.pdf" is the input file name to be processed
"Draft" is the text written as transparent "watermark" on top of each page
"230" is the font size
"0.2" is the opacity (1.0 completely opaque, 0.0 completely transparent)
"output.pdf" is the output file name
Call it from within other Java code:
Watermarker.main(new String[]{"input.pdf","Draft","230","0.2","output.pdf"});
args
- the srcfile, watermark text and destfile
|
Hosted by Hostbasket | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |