CPDFView.h 19 KB

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