PSPDFFileAppearanceStreamGenerator
Objective-C
@interface PSPDFFileAppearanceStreamGenerator
: NSObject <PSPDFAppearanceStreamGenerating>
Swift
class FileAppearanceStreamGenerator : NSObject, AppearanceStreamGenerating
An appearance stream generator that takes an NSURL
to any PDF file and returns it as the appearance stream.
Custom appearance streams are only intended to be used with stamp annotations to create a vector stamp. Using this class with other annotation types is not supported.
-
Unavailable
Not the designated initializer
Undocumented
Declaration
Objective-C
PSPDF_EMPTY_INIT_UNAVAILABLE
-
Unavailable
Not the designated initializer
Undocumented
Declaration
Objective-C
PSPDF_EMPTY_INIT_UNAVAILABLE
-
Initializes the
PSPDFFileAppearanceStreamGenerator
with the given file URL.Declaration
Objective-C
- (nonnull instancetype)initWithFileURL:(nonnull NSURL *)fileURL;
Swift
init(fileURL: URL)
-
The file URL that will be used to generate the appearance stream from.
Declaration
Objective-C
@property (nonatomic, readonly) NSURL *_Nonnull fileURL;
Swift
var fileURL: URL { get }
-
If set, gets called with a
CGContextRef
instance that can be used to customize how the annotation gets drawn in the document. This may be used to create a vector stamps by drawing in code.The context will be set up with the y-axis increasing upwards. It may be easiest to use Core Graphics and Core Text because using the UIKit drawing API will result in flipped images unless you flip the coordinate space.
Drawing will be aligned with the stamp annotation rotation. This means the annotation boundingBox is not appropriate to use if the annotation rotation is not zero. For now, our recommendation is to ensure the annotation is not rotated when the appearance stream is generated.
Declaration
Objective-C
@property (nonatomic, copy, nullable) void (^)(CGContextRef _Nonnull) drawingBlock;
Swift
var drawingBlock: ((CGContext) -> Void)? { get set }