CPDFWatermark Class Reference

Inherits from NSObject
Declared in CPDFWatermark.h

Overview

Add and delete image and text watermarks.

– initWithDocument:type:

Initializes the watermark.

- (instancetype)initWithDocument:(CPDFDocument *)document type:(CPDFWatermarkType)type

Parameters

document

The document with which the watermark is associated.

type

The type index of the watermark.

Discussion

Initializes the watermark.

Declared In

CPDFWatermark.h

  type

Returns the type for the watermark.

@property (nonatomic, readonly) CPDFWatermarkType type

Discussion

Returns the type for the watermark.

Declared In

CPDFWatermark.h

  text

Method to get / set the text for the watermark (image watermark does not work).

@property (nonatomic, copy) NSString *text

Discussion

Method to get / set the text for the watermark (image watermark does not work).

Declared In

CPDFWatermark.h

  textFont

Method to get / set the text font for the watermark (image watermark does not work).

@property (nonatomic, retain) CPDFKitPlatformFont *textFont

Discussion

Method to get / set the text font for the watermark (image watermark does not work).

The text font for the watermark; may return NULL if the watermark was created with image. Default Font : Helvetica 24

Declared In

CPDFWatermark.h

  textColor

Method to get / set the text color for the watermark (image watermark does not work).

@property (nonatomic, retain) CPDFKitPlatformColor *textColor

Discussion

Method to get / set the text color for the watermark (image watermark does not work).

Declared In

CPDFWatermark.h

  image

Method to get / set the image for the watermark (text watermark does not work).

@property (nonatomic, retain) CPDFKitPlatformImage *image

Discussion

Method to get / set the image for the watermark (text watermark does not work).

Declared In

CPDFWatermark.h

  scale

Method to get / set the scale factor for the watermark.

@property (nonatomic, assign) CGFloat scale

Discussion

Method to get / set the scale factor for the watermark.

Default is 1.0.

Declared In

CPDFWatermark.h

  rotation

Method to get / set the rotation for the watermark.

@property (nonatomic, assign) CGFloat rotation

Discussion

Method to get / set the rotation for the watermark.

Range : 0~360, Default is 0.0.

Declared In

CPDFWatermark.h

  opacity

Method to get / set the opacity for the watermark.

@property (nonatomic, assign) CGFloat opacity

Discussion

Method to get / set the opacity for the watermark.

Range : 0~1, Default is 1.0.

Declared In

CPDFWatermark.h

  pageRange

Method to get / set the page range for the watermark.

@property (nonatomic, assign) NSRange pageRange

Discussion

Method to get / set the page range for the watermark.

If not set, default to all pages.

Declared In

CPDFWatermark.h

  pageString

Method to get / set the page range for the watermark by string.

@property (nonatomic, retain) NSString *pageString

Discussion

Method to get / set the page range for the watermark by string.

A page range string, Such as “0,3,5-7”.

Declared In

CPDFWatermark.h

  verticalPosition

Method to get / set the vertical position for the watermark.

@property (nonatomic, assign) CPDFWatermarkVerticalPosition verticalPosition

Discussion

Method to get / set the vertical position for the watermark.

Default is CPDFWatermarkVerticalPositionCenter.

Declared In

CPDFWatermark.h

  horizontalPosition

Method to get / set the horizontal position for the watermark.

@property (nonatomic, assign) CPDFWatermarkHorizontalPosition horizontalPosition

Discussion

Method to get / set the horizontal position for the watermark.

Default is CPDFWatermarkHorizontalPositionCenter.

Declared In

CPDFWatermark.h

  tx

Method to get / set the horizontal translation for the watermark.

@property (nonatomic, assign) CGFloat tx

Discussion

Method to get / set the horizontal translation for the watermark.

The translation relative to the horizontal position.

Declared In

CPDFWatermark.h

  ty

Method to get / set the vertical translation for the watermark.

@property (nonatomic, assign) CGFloat ty

Discussion

Method to get / set the vertical translation for the watermark.

The translation relative to the vertical position.

Declared In

CPDFWatermark.h

  isFront

Method to get/set watermark to locate in front of the content.

@property (nonatomic, assign) BOOL isFront

Discussion

Method to get/set watermark to locate in front of the content.

Declared In

CPDFWatermark.h

  isTilePage

Method to get / set tiled watermark for the page(image watermark does not work).

@property (nonatomic, assign) BOOL isTilePage

Discussion

Method to get / set tiled watermark for the page(image watermark does not work).

Declared In

CPDFWatermark.h

  verticalSpacing

Method to get / set the vertical spacing for the tiled watermark.

@property (nonatomic, assign) CGFloat verticalSpacing

Discussion

Method to get / set the vertical spacing for the tiled watermark.

Declared In

CPDFWatermark.h

  horizontalSpacing

Method to get / set the horizontal spacing for the tiled watermark.

@property (nonatomic, assign) CGFloat horizontalSpacing

Discussion

Method to get / set the horizontal spacing for the tiled watermark.

Declared In

CPDFWatermark.h