watermarkPdf
- addBackgroundImage
- addFooter
- addHeader
- addLineNumbering
- addPageBorders
- addProperties
- addSection
- createDocx
- createCharacterStyle
- createListStyle
- createParagraphStyle
- createTableStyle
- docxSettings
- embedFont
- importHeadersAndFooters
- importStyles
- modifyPageLayout
- removeFooters
- removeHeaders
- setBackgroundColor
- setDefaultFont
- setDocumentDefaultStyles
- setEncodeUTF8
- setLanguage
- setMarkAsFinal
- setRTL
- addBibliography
- addBookmark
- addBreak
- addChart
- addCitation
- addComment
- addCrossReference
- addDateAndHour
- addEndnote
- addExternalFile
- addFootnote
- addFormElement
- addHeading
- addImage
- addLink
- addList
- addMathEquation
- addMergeField
- addOLE
- addPageNumber
- addShape
- addSimpleField
- addSource
- addStructuredDocumentTag
- addTable
- addTableContents
- addText
- addTextBox
- addWordML
- embedHTML
- clearBlocks
- deleteTemplateBlock
- getTemplateVariables
- getTemplateVariablesType
- modifyInputFields
- modifyMergeFields
- processTemplate
- removeTemplateVariable
- replaceListVariable
- replacePlaceholderImage
- replaceTableVariable
- replaceVariableByExternalFile
- replaceVariableByHtml
- replaceVariableByText
- replaceVariableByWordFragment
- replaceVariableByWordML
- setTemplateSymbol
- tickCheckbox
watermarkPdf
ADVANCED / PREMIUM
BASIC
Inserts a watermark into a PDF document.
Description
public void watermarkPDF(String source, String target, String type, HashMap options) throws Exception
This method allows you to insert a watermark image or text in a PDF document.
Parameters
source
Path to the PDF document.
target
Path to the resulting watermarked document.
type
Watermark type: "text" or "image".
options
If type is "image":
Option | Type | Description |
---|---|---|
image | String | Path to the watermark image. |
positionX | Integer | X-asis position (page center as default). |
positionY | Integer | Y-asis position (page center as default). |
If type is "text":
Option | Type | Description |
---|---|---|
text | String | The string of text used for watermarking. |
positionX | Integer | X-asis position (page center as default). |
positionY | Integer | Y-asis position (page center as default). |
font | String | The font-family. It must be installed in the OS. |
size | Integer | Font size. |
color | Integer | HEX value. |
Code samples
Example #1
Example #2