//
// TrustSignPDFDS.h
// TrustSignPDFDS
//
// Created by WangLi on 2016/10/31.
// Copyright © 2016年 CFCA. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#ifndef _PDF_BOOKVIEW_
#define _PDF_BOOKVIEW_
#pragma mark - TrustSignPDFTapInfo functions
typedef NS_ENUM(NSInteger, PDFTapAreaType) {
PDFTapAreaTypeDefault = 0,
PDFTapAreaTypeSignaturedWidget = 1,
PDFTapAreaTypeReservedArea = 2,
PDFTapAreaTypeInvalid = 3
};
@interface PDFTapAreaInfo : NSObject
@property (nonatomic, assign, readonly)PDFTapAreaType tapAreaType;
@property (nonatomic, assign, readonly)CGPoint tapPointInBookView;
@property (nonatomic, assign, readonly)CGPoint tapPointInPDF;//point in pdf page, not in bookview
@property (nonatomic, assign, readonly)CGRect widgetFrame; //rect in pdf page, not in bookview
@property (nonatomic, assign, readonly)NSUInteger pageNo; //from 0 start
@end
#pragma mark - TrustSignPDFPageInfo functions
@interface PDFPageInfo : NSObject
@property (nonatomic, assign, readonly)CGFloat zoomScale;
@property (nonatomic, assign, readonly)CGRect pdfImageFrame;//Relative to bookview
@property (nonatomic, assign, readonly)CGSize pdfOriginalPageSize;
@property (nonatomic, assign, readonly)NSUInteger pageNo;//from 0 start
@end
#endif
#ifndef _PDF_DOCUMENT_SEAL_
#define _PDF_DOCUMENT_SEAL_
typedef NS_ENUM(NSUInteger, PDFVerifySealResult) {
PDFVerifySealResultUnknown = 0,
PDFVerifySealResultSuccess = 1,
PDFVerifySealResultAbnormal = 2,
PDFVerifySealResultIsWedgetReservedArea = 3,
PDFVerifySealResultFailure = 4
};
typedef NS_ENUM(NSInteger, PDFSealSignatureStatus) {
PDFSealSignatureStatusUnsigned = -2,
PDFSealSignatureStatusUnsupported_filter = -1,
PDFSealSignatureStatusInvalid = 0,
PDFSealSignatureStatusValid = 1
};
typedef NS_OPTIONS(NSInteger, PDFSealCertStatusMask) {
PDFSealCertStatusError = -1,
PDFSealCertStatusOK = 0,
PDFSealCertStatusMaskTimeInvalid = (1 << 1),
PDFSealCertStatusMaskCertChainInvalid = (1 << 2),
PDFSealCertStatusMaskCrlInvalid = (1 << 4)
};
typedef NS_OPTIONS(NSUInteger, PDFSealTimestampStatusMask) {
PDFSealTimestampStatusOK = 0,
PDFSealTimestampStatusMaskSignInvalid = (1 << 0),
PDFSealTimestampStatusMaskCertInvalid = (1 << 1),
PDFSealTimestampStatusMaskHashInvalid = (1 << 2)
};
@interface PDFSealSignatureInfo : NSObject
@property (nonatomic, assign, readonly) PDFVerifySealResult verifySealResult;
@property (nonatomic, assign, readonly)NSUInteger pageNo;
@property (nonatomic, assign, readonly)CGRect widgetRectInPDF;
@property (nonatomic, strong, readonly) NSString *reason;
@property (nonatomic, strong, readonly) NSString *date;
@property (nonatomic, strong, readonly) NSString *location;
@property (nonatomic, strong, readonly) NSString *contact;
@property (nonatomic, strong, readonly) NSData *contents;
@property (nonatomic, strong, readonly) NSData *cert;
@property (nonatomic, assign, readonly) PDFSealSignatureStatus signatureStatus;
@property (nonatomic, assign, readonly) PDFSealCertStatusMask certStatus;
@property (nonatomic, assign, readonly) BOOL existTimestamp;
@property (nonatomic, assign, readonly) PDFSealTimestampStatusMask timestampStatus;
@property (nonatomic, assign, readonly) time_t timestampTime;
@property (nonatomic, strong, readonly) NSString *timestampTimeStr;
@property (nonatomic, strong, readonly) NSString *tsaCN;
@property (nonatomic, strong, readonly) NSData *tsaCert;
@end
#pragma mark - PDFSealInfoData
/*!
@enum PDFSealType
@abstract seal type, include 2 types.
*/
typedef NS_ENUM(NSUInteger, PDFSealType) {
PDFSealTypeInvisible = 0,
PDFSealTypeImage = 1
};
/*!
@enum PDFSealCipherType
@abstract seal cipher type, include 3 types.
*/
typedef NS_ENUM(NSUInteger, PDFSealCipherType) {
PDFSealCipherTypeRSA1024 = 0,
PDFSealCipherTypeRSA2048 = 1,
PDFSealCipherTypeSM2 = 2
};
/*!
@enum PDFSealHashType
@abstract hash type, include 3 types.
*/
typedef NS_ENUM(NSUInteger, PDFSealHashType) {
PDFSealHashTypeSHA1 = 0,
PDFSealHashTypeSHA256 = 1,
PDFSealHashTypeSHA384 = 2,
PDFSealHashTypeSM3 = 3
};
/*!
@enum PDFSignResult
@abstract sign result type, include 4 types.
*/
typedef NS_ENUM(NSUInteger, PDFSealResult) {
PDFSignResultSucess = 0,
PDFSignResultInvalidPoint = 1,
PDFSignResultException = 2,
PDFSignResultFailed = 3,
PDFSignResultTimestampFailed = 4
};
/*!
@enum PDFSealAreaType
@abstract seal area type, include 2 types.
PDFSealAreaTypeFix: fixed area to seal
PDFSealAreaTypeCustom: seal in anywhere
*/
typedef NS_ENUM(NSUInteger, PDFSealAreaType) {
PDFSealAreaTypeFix = 0,
PDFSealAreaTypeCustom = 1
};
@interface PDFSealInfo : NSObject
@property (nonatomic, strong)NSString *reason;
@property (nonatomic, strong)NSString *location;
@property (nonatomic, strong)NSString *contact;
@property (nonatomic, strong)NSData *imageData;
@property (nonatomic, strong)NSArray *maskFrom;
@property (nonatomic, strong)NSArray *maskTo;
@property (nonatomic, assign)CGFloat alpha;
@property (nonatomic, assign)CGPoint sealPointInPDF;
@property (nonatomic, strong)NSData *ZValue;
@end
#endif
typedef NS_ENUM(NSInteger, TrustSignPDFDSReadStyle) {
TrustSignPDFDSReadStyleSingle = 0,
TrustSignPDFDSReadStyleSequential,
};
typedef NS_ENUM(NSInteger, TrustSignPDFDSPasswordState) {
TrustSignPDFDSPasswordStateNoPassword = 0,
TrustSignPDFDSPasswordStateNeedPassword = 1,
TrustSignPDFDSPasswordStateVerifiedPassword = 2
};
@protocol TrustSignPDFDSDelegate <NSObject>
/*!
@abstract when pdf page moved call this delegate
@param [OUT]firstPageNo : the first active page number
@param [OUT]proportion : current page proportion
@param [OUT]isDocumentEnd : wether document scroll end
*/
- (void)didPageScrolled:(NSUInteger)firstPageNo offset:(CGFloat)offset positionOffsetProportion:(CGFloat)proportion isDocumentEnd:(BOOL)isDocumentEnd;
/*!
@abstract when tap pdf book view call this delegate
@param [OUT]tapAreaInfo : the taped area info
*/
-(void)didPDFBookViewTapped:(PDFTapAreaInfo*)tapAreaInfo;
@end
@interface TrustSignPDFDS : UIView
@property (nonatomic, assign, readonly)TrustSignPDFDSPasswordState passwordState;
- (instancetype)initWithPDFPath:(NSString *)pdfPath
frame:(CGRect)frame
pageNo:(NSUInteger)pageNo
offset:(CGFloat)offset
readStyle:(TrustSignPDFDSReadStyle)readStyle
delegate:(id<TrustSignPDFDSDelegate>)delegate
errorCode:(NSInteger *)errorCode;
+ (NSString *)getVersion;
/*!
@abstract get pdf file path
*/
- (NSString *)pdfFilePath;
/*!
@abstract get total page number
*/
- (NSUInteger)pageCount;
/*!
@abstract set and get current read style
*/
- (TrustSignPDFDSReadStyle)readStyle;
- (NSInteger)setReadStyle:(TrustSignPDFDSReadStyle)readStyle;
/*!
@abstract enable and disable zoom
*/
- (BOOL)zoomEnable;
- (NSInteger)setZoomEnable:(BOOL)zoomEnable;
/*!
@abstract set and get wether show seek bar
*/
- (BOOL)showSeekBar;
- (NSInteger)setShowSeekBar:(BOOL)showSeekBar;
/*!
@abstract set and get current page proportion
*/
- (CGFloat)positionOffsetProportion;
- (NSInteger)setPositionOffsetProportion:(CGFloat)positionOffsetProportion;
/*!
@abstract current page scale, 1.f is not zoom
*/
- (CGFloat)zoomScale;
/*!
@abstract verify pdf file password.
@param [in]pdfPassword : password to verify
@result [out]0 is OK, other is error
*/
- (NSInteger)verifyPDFPassword:(NSString *)pdfPassword;
/*!
@abstra

liwei5bao
- 粉丝: 6
最新资源
- 财务信息化:促进中小企业发展的方法探究.docx
- 智能家居—可能性研究分析评测报告.doc
- 互联网+一站式校园创业服务探索.docx
- 项目管理中的人力资源管理和沟通管理.docx
- 云计算网络环境下的信息安全问题研究.docx
- 大学设计箱体注塑模CADCAM方案一.doc
- 大数据下的医院财务信息共享研究.docx
- C语言程序设计算法资料.ppt
- PLC控制机械手95153.doc
- 学生成绩管理系统数据结构程序设计实验报告2.doc
- 网络工程第一章ppt.ppt
- 学校、幼儿园网络视频监控方案-教育文博.docx
- 大模型提示词优化器,让大模型根据测试结果进行反思生成优化建议,并结合用户要求进行提示词优化
- 单片机的按摩机的控制研究与设计开发.doc
- 伪均匀随机数的计算机检验.docx
- 大模型提示词优化器:依测试反思提建议并按用户要求优化
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈


