1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- //
- // BLBookletManager.h
- // Booklet
- //
- // Created by 蒋志鹏 on 2018/5/3.
- // Copyright © 2018年 NO1. All rights reserved.
- //
- #import <Foundation/Foundation.h>
- #import <Quartz/Quartz.h>
- @class PDFPage;
- @class KMBookletParameterModel;
- typedef void(^Booklet_GenerateNewPDFBlock)(BOOL success,NSString *urlString);
- @interface KMBookletManager : NSObject
- //单例方法
- + (instancetype)sharedManager;
- /**
- 根据参数对象生成PDF
- @param parameterModel 参数对象
- @param handle 回调
- */
- - (void)generateNewPDFWithParameterModel:(KMBookletParameterModel*)parameterModel
- completionHandler:(Booklet_GenerateNewPDFBlock) handle;
- /**
- 根据模型对象,生成最后用来绘制的数组,其中,每个数组两个元素(一张page画两个page)
- @param parameterModel 参数对象
- @return 绘制数组
- */
- - (NSArray *)fetchDrawPageArraysWithModel:(KMBookletParameterModel *)parameterModel;
- /**
- 绘制PDF
- @param myPDFContext 画布对象
- @param parameterModel 参数对象
- @param subArr 绘制page数组
- */
- - (void)drawPageWithContext:(CGContextRef) myPDFContext
- parameterModel:(KMBookletParameterModel *)parameterModel
- printArray:(NSArray *)subArr;
- /**
- 对原始数组进行重组,比如0,1,2,3,4,5--> [0,5],[4,1],[2,3],数字代表数组下标
- @param primaryArray 待处理数组
- @return 处理好的数组
- */
- - (NSMutableArray *)regroupBothSidesPrintArrayWithPrimaryArray:(NSArray *)primaryArray;
- @end
|