CPDFView.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643
  1. //
  2. // CPDFView.h
  3. // ComPDFKit
  4. //
  5. // Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
  6. //
  7. // THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
  8. // AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
  9. // UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
  10. // This notice may not be removed from this file.
  11. //
  12. #import <UIKit/UIKit.h>
  13. #import <ComPDFKit/CPDFKitPlatform.h>
  14. @class CPDFView, CPDFDocument, CPDFPage, CPDFSelection, CPDFDestination, CPDFFreeTextAnnotation, CPDFTextWidgetAnnotation;
  15. typedef NS_OPTIONS(NSInteger, CEditingSelectState) {
  16. CEditingSelectStateEmpty = 0,
  17. CEditingSelectStateEditTextArea,
  18. CEditingSelectStateEditNoneText,
  19. CEditingSelectStateEditSelectText,
  20. };
  21. typedef NS_OPTIONS(NSInteger, CEditingLoadType) {
  22. CEditingLoadTypeText = (1UL << 0),
  23. CEditingLoadTypeImage = (1UL << 1),
  24. };
  25. typedef NS_ENUM(NSInteger, CPDFDisplayDirection) {
  26. CPDFDisplayDirectionVertical = 0,
  27. CPDFDisplayDirectionHorizontal = 1,
  28. };
  29. typedef NS_ENUM(NSInteger, CPDFDisplayMode) {
  30. CPDFDisplayModeNormal = 0,
  31. CPDFDisplayModeNight = 1,
  32. CPDFDisplayModeSoft = 2,
  33. CPDFDisplayModeGreen = 3,
  34. CPDFDisplayModeCustom = 4
  35. };
  36. extern NSNotificationName const CPDFViewDocumentChangedNotification;
  37. extern NSNotificationName const CPDFViewPageChangedNotification;
  38. #pragma mark - CPDFEditArea
  39. @interface CPDFEditArea : NSObject
  40. /**
  41. * Gets the current page of the text block.
  42. */
  43. @property (nonatomic,readonly) CPDFPage *page;
  44. /**
  45. * Gets the position size of the text block.
  46. */
  47. @property (nonatomic,readonly) CGRect bounds;
  48. /**
  49. * Gets the current selection.
  50. */
  51. @property (nonatomic,readonly) CPDFSelection *selection;
  52. /**
  53. * Whether it is text code block.
  54. */
  55. - (BOOL)IsTextArea;
  56. @end
  57. #pragma mark - CPDFEditTextArea
  58. @interface CPDFEditTextArea : CPDFEditArea
  59. @end
  60. @interface CPDFEditingConfig : NSObject
  61. /**
  62. * Sets the unselected border color of the text code block.
  63. */
  64. @property (nonatomic,retain) CPDFKitPlatformColor *editingBorderColor;
  65. /**
  66. * Sets the selected border color of the text code block.
  67. */
  68. @property (nonatomic,retain) CPDFKitPlatformColor *editingSelectionBorderColor;
  69. /**
  70. * Border width of the text code block.
  71. */
  72. @property (nonatomic,assign) CGFloat editingBorderWidth;
  73. /**
  74. * Array of dashed lines of the text code block.
  75. */
  76. @property (nonatomic,retain) NSArray * editingBorderDashPattern;
  77. /**
  78. * Sets the offset interval at which blocks are displayed
  79. */
  80. @property (nonatomic,assign) CGFloat editingOffsetGap;
  81. /**
  82. * Set the move range spacing for the text editing page
  83. */
  84. @property (nonatomic,assign) CGFloat pageSpacingGap;
  85. @end
  86. @protocol CPDFViewDelegate <NSObject>
  87. @optional
  88. - (void)PDFViewDocumentDidLoaded:(CPDFView *)pdfView;
  89. - (void)PDFViewCurrentPageDidChanged:(CPDFView *)pdfView;
  90. - (void)PDFViewDidClickOnLink:(CPDFView *)pdfView withURL:(NSString *)url;
  91. - (void)PDFViewPerformURL:(CPDFView *)pdfView withContent:(NSString *)content;
  92. - (void)PDFViewPerformUOP:(CPDFView *)pdfView withContent:(NSString *)content;
  93. - (void)PDFViewPerformPrint:(CPDFView *)pdfView;
  94. - (void)PDFViewPerformReset:(CPDFView *)pdfView;
  95. - (void)PDFViewShouldBeginEditing:(CPDFView *)pdfView textView:(UITextView *)textView forAnnotation:(CPDFFreeTextAnnotation *)annotation;
  96. - (void)PDFViewShouldEndEditing:(CPDFView *)pdfView textView:(UITextView *)textView forAnnotation:(CPDFFreeTextAnnotation *)annotation;
  97. - (void)PDFViewShouldBeginEditing:(CPDFView *)pdfView textView:(UITextView *)textView forTextWidget:(CPDFTextWidgetAnnotation *)textWidget;
  98. - (void)PDFViewShouldEndEditing:(CPDFView *)pdfView textView:(UITextView *)textView forTextWidget:(CPDFTextWidgetAnnotation *)textWidget;
  99. - (void)PDFViewDidEndDragging:(CPDFView *)pdfView;
  100. - (void)PDFViewEditingCropBoundsDidChanged:(CPDFView *)pdfView editingArea:(CPDFEditArea *)editArea;
  101. - (void)PDFViewEditingOperationDidChanged:(CPDFView *)pdfView;
  102. - (void)PDFViewEditingSelectStateDidChanged:(CPDFView *)pdfView;
  103. - (void)PDFEditingViewShouldBeginEditing:(CPDFView *)pdfView textView:(UITextView *)textView;
  104. - (void)PDFEditingViewShouldEndEditing:(CPDFView *)pdfView textView:(UITextView *)textView;
  105. @end
  106. /**
  107. * This class is the main view of ComPDFKit you can instantiate a CPDFView that will host the contents of a CPDFDocument.
  108. *
  109. * @discussion CPDFView may be the only class you need to deal with for adding PDF functionality to your application.
  110. * It lets you display PDF data and allows users to select content, navigate through a document, set zoom level, and copy textual content to the Pasteboard.
  111. * CPDFView also keeps track of page history. You can subclass CPDFView to create a custom PDF viewer.
  112. */
  113. @interface CPDFView : UIView
  114. #pragma mark - Document
  115. /**
  116. * Methods for associating a CPDFDocument with a CPDFView.
  117. */
  118. @property (nonatomic,retain) CPDFDocument *document;
  119. #pragma mark - Accessors
  120. /**
  121. * Returns the view’s delegate.
  122. *
  123. * @see CPDFViewDelegate
  124. */
  125. @property (nonatomic,assign) id<CPDFViewDelegate> delegate;
  126. /**
  127. * A Boolean value indicating whether the document displays two pages side-by-side.
  128. */
  129. @property (nonatomic,assign) BOOL displayTwoUp;
  130. /**
  131. * Specifies whether the first page is to be presented as a cover and displayed by itself (for two-up modes).
  132. */
  133. @property (nonatomic,assign) BOOL displaysAsBook;
  134. /**
  135. * The layout direction, either vertical or horizontal, for the given display mode.
  136. *
  137. * @discussion Defaults to vertical layout (CPDFDisplayDirectionVertical).
  138. * @see CPDFDisplayDirection
  139. */
  140. @property (nonatomic,assign) CPDFDisplayDirection displayDirection;
  141. /**
  142. * A Boolean value indicating whether the view is displaying page breaks.
  143. *
  144. * @discussion Toggle displaying or not displaying page breaks (spacing) between pages. This spacing value is defined by the pageBreakMargins property.
  145. * If displaysPageBreaks is NO, then pageBreakMargins will always return { 10.0, 10.0, 10.0, 10.0 }. Default is YES.
  146. */
  147. @property (nonatomic,assign) BOOL displaysPageBreaks;
  148. /**
  149. * The spacing between pages as defined by the top, bottom, left, and right margins.
  150. *
  151. * @discussion If displaysPageBreaks is enabled, you may customize the spacing between pages by defining margins for the top, bottom, left, and right of each page.
  152. * Note that pageBreakMargins only allows positive values and will clamp any negative value to 0.0.
  153. * By default, if displaysPageBreaks is enabled, pageBreakMargins is { 10.0, 10.0, 10.0, 10.0 } (with respect to top, left, bottom, right), otherwise it is { 0.0, 0.0, 0.0, 0.0 }.
  154. */
  155. @property (nonatomic,assign) UIEdgeInsets pageBreakMargins;
  156. /**
  157. * The page render mode, either normal, night, soft, green or custom, for the given display mode.
  158. *
  159. * @see CPDFDisplayMode
  160. */
  161. @property (nonatomic,assign) CPDFDisplayMode displayMode;
  162. /**
  163. * If displayMode is CPDFDisplayModeCustom, you may customize the color of the page rendering.
  164. */
  165. @property (nonatomic,retain) UIColor *displayModeCustomColor;
  166. /**
  167. * A Boolean value indicating whether the view is displaying page crop.
  168. *
  169. * @discussion Automatically crop out valid content from the page, If there is no content in the page, no cropping will be done.
  170. */
  171. @property (nonatomic,assign) BOOL displayCrop;
  172. /**
  173. * A Boolean value that determines whether scrolling is enabled for the document view.
  174. */
  175. @property (nonatomic,assign) BOOL scrollEnabled;
  176. /**
  177. * A Boolean value that determines whether scrolling is disabled in the vertical direction for the document view.
  178. */
  179. @property (nonatomic,assign) BOOL directionaHorizontalLockEnabled;
  180. /**
  181. * The current scale factor for the view.
  182. *
  183. * @discussion Method to get / set the current scaling on the displayed PDF document. Default is 1.0.
  184. */
  185. @property (nonatomic,assign) CGFloat scaleFactor;
  186. - (void)setScaleFactor:(CGFloat)scaleFactor animated:(BOOL)animated;
  187. #pragma mark - Draw
  188. @property (nonatomic,readonly) BOOL isDrawing;
  189. @property (nonatomic,readonly) BOOL isDrawErasing;
  190. - (void)beginDrawing;
  191. - (void)endDrawing;
  192. - (void)commitDrawing;
  193. - (void)setDrawErasing:(BOOL)isErasing;
  194. - (void)drawUndo;
  195. - (void)drawRedo;
  196. #pragma mark - Annotation
  197. - (void)editAnnotationFreeText:(CPDFFreeTextAnnotation *)freeText;
  198. - (void)commitEditAnnotationFreeText;
  199. - (void)setEditAnnotationFreeTextFont:(UIFont *)font;
  200. - (void)setEditAnnotationFreeTextColor:(UIColor *)color;
  201. #pragma mark - Page
  202. /**
  203. * Returns the current page index.
  204. */
  205. @property (nonatomic,readonly) NSInteger currentPageIndex;
  206. /**
  207. * Scrolls to the specified page.
  208. */
  209. - (void)goToPageIndex:(NSInteger)pageIndex animated:(BOOL)animated;
  210. /**
  211. * Returns a CPDFDestination object representing the current page and the current point in the view specified in page space.
  212. */
  213. @property (nonatomic,readonly) CPDFDestination *currentDestination;
  214. /**
  215. * Goes to the specified destination.
  216. *
  217. * Destinations include a page and a point on the page specified in page space.
  218. */
  219. - (void)goToDestination:(CPDFDestination *)destination animated:(BOOL)animated;
  220. /**
  221. * Goes to the specified rectangle on the specified page.
  222. *
  223. * @discussion This allows you to scroll the CPDFView object to a specific CPDFAnnotation or CPDFSelection object,
  224. * because both of these objects have bounds methods that return an annotation or selection position in page space.
  225. * Note that rect is specified in page-space coordinates. Page space is a coordinate system with the origin at the lower-left corner of the current page.
  226. */
  227. - (void)goToRect:(CGRect)rect onPage:(CPDFPage *)page animated:(BOOL)animated;
  228. /**
  229. * Returns an array of CPDFPage objects that represent the currently visible pages.
  230. */
  231. @property (nonatomic,readonly) NSArray<CPDFPage *> *visiblePages;
  232. #pragma mark - Selection
  233. /**
  234. * Enter text selection mode.
  235. *
  236. * @discussion The scrollEnabled is NO in the text selection mode.
  237. */
  238. @property (nonatomic,assign) BOOL textSelectionMode;
  239. /**
  240. * Returns actual instance of the current CPDFSelection object.
  241. *
  242. * @discussion The view redraws as necessary but does not scroll.
  243. */
  244. @property (nonatomic,readonly) CPDFSelection *currentSelection;
  245. /**
  246. * Clears the selection.
  247. *
  248. * @discussion The view redraws as necessary but does not scroll.
  249. */
  250. - (void)clearSelection;
  251. /**
  252. * Goes to the first character of the specified selection.
  253. */
  254. - (void)goToSelection:(CPDFSelection *)selection animated:(BOOL)animated;
  255. /**
  256. * The following calls allow you to associate a CPDFSelection with a CPDFView.
  257. *
  258. * @discussion The selection do not go away when the user clicks in the CPDFView, etc. You must explicitly remove them by passing nil to -[setHighlightedSelection:animated:].
  259. * This method allow you to highlight text perhaps to indicate matches from a text search. Commonly used for highlighting search results.
  260. */
  261. - (void)setHighlightedSelection:(CPDFSelection *)selection animated:(BOOL)animated;
  262. #pragma mark - Display
  263. /**
  264. * The innermost view used by CPDFView or by your CPDFView subclass.
  265. *
  266. * @discussion The innermost view is the one displaying the visible document pages.
  267. */
  268. - (UIScrollView *)documentView;
  269. /**
  270. * Performs layout of the inner views.
  271. *
  272. * @discussion The CPDFView actually contains several subviews. Changes to the PDF content may require changes to these inner views,
  273. * so you must call this method explicitly if you use PDF Kit utility classes to add or remove a page, rotate a page, or perform other operations affecting visible layout.
  274. * This method is called automatically from CPDFView methods that affect the visible layout (such as setDocument:).
  275. */
  276. - (void)layoutDocumentView;
  277. /**
  278. * Draw and render of the currently visible pages.
  279. */
  280. - (void)setNeedsDisplayForVisiblePages;
  281. /**
  282. * Draw and render of the specified page.
  283. */
  284. - (void)setNeedsDisplayForPage:(CPDFPage *)page;
  285. #pragma mark - Rendering
  286. /**
  287. * Draw and render a visible page to a context.
  288. *
  289. * @discussion For subclasses. This method is called for each visible page requiring rendering. By subclassing you can draw on top of the PDF page.
  290. */
  291. - (void)drawPage:(CPDFPage *)page toContext:(CGContextRef)context;
  292. #pragma mark - Menu
  293. - (NSArray<UIMenuItem *> *)menuItemsAtPoint:(CGPoint)point forPage:(CPDFPage *)page;
  294. #pragma mark - Touch
  295. - (void)touchBeganAtPoint:(CGPoint)point forPage:(CPDFPage *)page;
  296. - (void)touchMovedAtPoint:(CGPoint)point forPage:(CPDFPage *)page;
  297. - (void)touchEndedAtPoint:(CGPoint)point forPage:(CPDFPage *)page;
  298. - (void)touchCancelledAtPoint:(CGPoint)point forPage:(CPDFPage *)page;
  299. #pragma mark - Conversion
  300. /**
  301. * Converts a point from view space to page space.
  302. *
  303. * @discussion Page space is a coordinate system with the origin at the lower-left corner of the current page.
  304. * View space is a coordinate system with the origin at the upper-left corner of the current PDF view.
  305. */
  306. - (CGPoint)convertPoint:(CGPoint)point toPage:(CPDFPage *)page;
  307. /**
  308. * Converts a rectangle from view space to page space.
  309. *
  310. * @discussion Page space is a coordinate system with the origin at the lower-left corner of the current page.
  311. * View space is a coordinate system with the origin at the upper-left corner of the current PDF view.
  312. */
  313. - (CGRect)convertRect:(CGRect)rect toPage:(CPDFPage *)page;
  314. /**
  315. * Converts a point from page space to view space.
  316. *
  317. * @discussion Page space is a coordinate system with the origin at the lower-left corner of the current page.
  318. * View space is a coordinate system with the origin at the upper-left corner of the current PDF view.
  319. */
  320. - (CGPoint)convertPoint:(CGPoint)point fromPage:(CPDFPage *)page;
  321. /**
  322. * Converts a rectangle from page space to view space.
  323. *
  324. * @discussion Page space is a coordinate system with the origin at the lower-left corner of the current page.
  325. * View space is a coordinate system with the origin at the upper-left corner of the current PDF view.
  326. */
  327. - (CGRect)convertRect:(CGRect)rect fromPage:(CPDFPage *)page;
  328. #pragma mark - Edit
  329. /**
  330. * This method is about configuring of editing content.
  331. */
  332. @property (nonatomic,retain) CPDFEditingConfig *editingConfig;
  333. /**
  334. * Begins editing content.
  335. */
  336. - (void)beginEditingLoadType:(CEditingLoadType)editingLoadType;
  337. /**
  338. * Change editing content.
  339. */
  340. - (void)changeEditingLoadType:(CEditingLoadType)editingLoadType;
  341. /**
  342. * Ends editing content.
  343. */
  344. - (void)endOfEditing;
  345. /**
  346. * Submits the edited content.
  347. */
  348. - (void)commitEditing;
  349. /**
  350. * Gets whether to enter the editing mode.
  351. */
  352. - (BOOL)isEditing;
  353. /**
  354. * Whether the content is modified.
  355. */
  356. - (BOOL)isEdited;
  357. /**
  358. * The selected block.
  359. */
  360. - (CPDFEditArea *)editingArea;
  361. /**
  362. * Sets the position of the text (image) block
  363. */
  364. - (void)setBoundsEditArea:(CPDFEditArea *)editArea withBounds:(CGRect)bounds;
  365. /**
  366. * Delete text (image) block
  367. */
  368. - (void)deleteEditingArea:(CPDFEditArea *)editArea;
  369. /**
  370. * Clicks the context menu of block.
  371. */
  372. - (NSArray<UIMenuItem *> *)menuItemsEditingAtPoint:(CGPoint)point forPage:(CPDFPage *)page;
  373. /**
  374. * Gets the font size of a text block or a piece of text.
  375. */
  376. - (CGFloat)editingSelectionFontSize;
  377. /**
  378. * Sets the font size of a text block or a piece of text.
  379. */
  380. - (void)setEditingSelectionFontSize:(CGFloat)fontSize;
  381. /**
  382. * Gets the font color of a text block or a piece of text.
  383. */
  384. - (CPDFKitPlatformColor *)editingSelectionFontColor;
  385. /**
  386. * Sets the font color of a text block or a piece of text.
  387. */
  388. - (void)setEditingSelectionFontColor:(CPDFKitPlatformColor *)fontColor;
  389. /**
  390. * Gets the alignment of a text block or a piece of text.
  391. */
  392. - (NSTextAlignment)editingSelectionAlignment;
  393. /**
  394. * Sets the alignment of a text block or a piece of text.
  395. */
  396. - (void)setCurrentSelectionAlignment:(NSTextAlignment)alignment;
  397. /**
  398. * The statuses when editing.
  399. *
  400. * @see CEditingSelectState
  401. */
  402. - (CEditingSelectState )editStatus;
  403. /**
  404. * Whether to support undo on current page.
  405. */
  406. - (BOOL)canEditTextUndo;
  407. /**
  408. * Whether to support redo on current page.
  409. */
  410. - (BOOL)canEditTextRedo;
  411. /**
  412. * Undo on current page.
  413. */
  414. - (void)editTextUndo;
  415. /**
  416. * Redo on current page.
  417. */
  418. - (void)editTextRedo;
  419. /**
  420. * The font name of the currently selected text block.
  421. */
  422. - (NSString *)editingSelectionFontName;
  423. /**
  424. * Sets the font name of the selected text block. (Several standard fonts are currently supported)
  425. */
  426. - (void)setEditingSelectionFontName:(NSString *)fontName;
  427. /**
  428. * Sets the currently selected text is italic.
  429. */
  430. - (void)setCurrentSelectionIsItalic:(BOOL)isItalic;
  431. /**
  432. * Whether the font of the currently selected text block is italic.
  433. */
  434. - (BOOL)isItalicCurrentSelection;
  435. /**
  436. * Sets the currently selected text is bold.
  437. */
  438. - (void)setCurrentSelectionIsBold:(BOOL)isBold;
  439. /**
  440. * Whether the font of the currently selected text block is bold.
  441. */
  442. - (BOOL)isBoldCurrentSelection;
  443. /**
  444. * Create a blank text block.
  445. * @param rect The area of the text box.
  446. * @param attributes The text font properties.
  447. * @param page The created page number.
  448. * @return Returns whether the creation is successful.
  449. */
  450. - (BOOL)createEmptyStringBounds:(CGRect)rect withAttributes:(NSDictionary<NSAttributedStringKey, id> *)attributes page:(CPDFPage *)page;
  451. /**
  452. * Gets the supported font name.
  453. */
  454. - (NSArray*)getFontList;
  455. /**
  456. * Sets text transparency.
  457. */
  458. - (BOOL)setCharsFontTransparency:(float)transparency;
  459. /*
  460. * Get the rotation Angle of the picture
  461. */
  462. - (void)getRotationEditArea:(CPDFEditArea*)editArea;
  463. /*
  464. * Sets the rotation angle of image.
  465. */
  466. - (void)rotateEditArea:(CPDFEditArea *)editArea rotateAngle:(float)angle;
  467. /*
  468. * Mirrors the image horizontally.
  469. */
  470. - (void)horizontalMirrorEditArea:(CPDFEditArea *)editArea;
  471. /*
  472. * Mirrors the image vertically.
  473. */
  474. - (void)verticalMirrorEditArea:(CPDFEditArea *)editArea;
  475. /*
  476. * Crops the specified size.
  477. */
  478. - (void)cropEditArea:(CPDFEditArea *)editArea WithRect:(CGRect)rect;
  479. /*
  480. * Gets the cropped size.
  481. */
  482. - (CGRect)getClipRectEditArea:(CPDFEditArea *)editArea;
  483. /*
  484. * Ends cropping.
  485. */
  486. - (void)beginCropEditArea:(CPDFEditArea *)editArea;
  487. /*
  488. * End cutting
  489. */
  490. - (void)endCropEditArea:(CPDFEditArea *)editArea;
  491. /*
  492. * Extracts the image to the specified path.
  493. */
  494. - (BOOL)extractImageEditArea:(CPDFEditArea *)editArea filePath:(NSString*)filePath;
  495. /*
  496. * Gets image transparency.
  497. */
  498. - (float)getImageTransparencyEditArea:(CPDFEditArea *)editArea;
  499. /*
  500. * Sets image transparency.
  501. */
  502. - (BOOL)setImageTransparencyEditArea:(CPDFEditArea *)editArea transparency:(float)transparency;
  503. /*
  504. * Adds interface of the image.
  505. */
  506. - (BOOL)createEmptyImage:(CGRect)rect page:(CPDFPage *)page path:(NSString*)imagePath;
  507. @end