CPDFView.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684
  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,CPDFAnnotation;
  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. - (void)longPressAnnotation:(CPDFAnnotation *)annotation atPoint:(CGPoint)point forPage:(CPDFPage *)page;
  310. #pragma mark - Conversion
  311. /**
  312. * Converts a point from view space to page space.
  313. *
  314. * @discussion Page space is a coordinate system with the origin at the lower-left corner of the current page.
  315. * View space is a coordinate system with the origin at the upper-left corner of the current PDF view.
  316. */
  317. - (CGPoint)convertPoint:(CGPoint)point toPage:(CPDFPage *)page;
  318. /**
  319. * Converts a rectangle from view space to page space.
  320. *
  321. * @discussion Page space is a coordinate system with the origin at the lower-left corner of the current page.
  322. * View space is a coordinate system with the origin at the upper-left corner of the current PDF view.
  323. */
  324. - (CGRect)convertRect:(CGRect)rect toPage:(CPDFPage *)page;
  325. /**
  326. * Converts a point from page space to view space.
  327. *
  328. * @discussion Page space is a coordinate system with the origin at the lower-left corner of the current page.
  329. * View space is a coordinate system with the origin at the upper-left corner of the current PDF view.
  330. */
  331. - (CGPoint)convertPoint:(CGPoint)point fromPage:(CPDFPage *)page;
  332. /**
  333. * Converts a rectangle from page space to view space.
  334. *
  335. * @discussion Page space is a coordinate system with the origin at the lower-left corner of the current page.
  336. * View space is a coordinate system with the origin at the upper-left corner of the current PDF view.
  337. */
  338. - (CGRect)convertRect:(CGRect)rect fromPage:(CPDFPage *)page;
  339. #pragma mark - Edit
  340. /**
  341. * This method is about configuring of editing content.
  342. */
  343. @property (nonatomic,retain) CPDFEditingConfig *editingConfig;
  344. @property (nonatomic,readonly) CEditingLoadType editingLoadType ;
  345. /**
  346. * Begins editing content.
  347. */
  348. - (void)beginEditingLoadType:(CEditingLoadType)editingLoadType;
  349. /**
  350. * Change editing content.
  351. */
  352. - (void)changeEditingLoadType:(CEditingLoadType)editingLoadType;
  353. /**
  354. * Ends editing content.
  355. */
  356. - (void)endOfEditing;
  357. /**
  358. * Submits the edited content.
  359. */
  360. - (void)commitEditing;
  361. /**
  362. * Gets whether to enter the editing mode.
  363. */
  364. - (BOOL)isEditing;
  365. /**
  366. * Whether the content is modified.
  367. */
  368. - (BOOL)isEdited;
  369. /**
  370. * The selected block.
  371. */
  372. - (CPDFEditArea *)editingArea;
  373. /**
  374. * Clicks the context menu of block.
  375. */
  376. - (NSArray<UIMenuItem *> *)menuItemsEditingAtPoint:(CGPoint)point forPage:(CPDFPage *)page;
  377. /**
  378. * The statuses when editing.
  379. *
  380. * @see CEditingSelectState
  381. */
  382. - (CEditingSelectState )editStatus;
  383. #pragma mark - Edit Text & Image
  384. /**
  385. * Sets the position of the text (image) block
  386. */
  387. - (void)setBoundsEditArea:(CPDFEditArea *)editArea withBounds:(CGRect)bounds;
  388. /**
  389. * Delete text (image) block
  390. */
  391. - (void)deleteEditingArea:(CPDFEditArea *)editArea;
  392. /**
  393. * Whether to support undo on current page.
  394. */
  395. - (BOOL)canEditTextUndo;
  396. /**
  397. * Whether to support redo on current page.
  398. */
  399. - (BOOL)canEditTextRedo;
  400. /**
  401. * Undo on current page.
  402. */
  403. - (void)editTextUndo;
  404. /**
  405. * Redo on current page.
  406. */
  407. - (void)editTextRedo;
  408. #pragma mark - Edit Text
  409. /**
  410. * Gets the font size of a text block or a piece of text.
  411. */
  412. - (CGFloat)editingSelectionFontSize;
  413. /**
  414. * Sets the font size of a text block or a piece of text.
  415. */
  416. - (void)setEditingSelectionFontSize:(CGFloat)fontSize;
  417. /**
  418. * Gets the font color of a text block or a piece of text.
  419. */
  420. - (CPDFKitPlatformColor *)editingSelectionFontColor;
  421. /**
  422. * Sets the font color of a text block or a piece of text.
  423. */
  424. - (void)setEditingSelectionFontColor:(CPDFKitPlatformColor *)fontColor;
  425. /**
  426. * Gets the alignment of a text block or a piece of text.
  427. */
  428. - (NSTextAlignment)editingSelectionAlignment;
  429. /**
  430. * Sets the alignment of a text block or a piece of text.
  431. */
  432. - (void)setCurrentSelectionAlignment:(NSTextAlignment)alignment;
  433. /**
  434. * The font name of the currently selected text block.
  435. */
  436. - (NSString *)editingSelectionFontName;
  437. /**
  438. * Sets the font name of the selected text block. (Several standard fonts are currently supported)
  439. */
  440. - (void)setEditingSelectionFontName:(NSString *)fontName;
  441. /**
  442. * Sets the currently selected text is italic.
  443. */
  444. - (void)setCurrentSelectionIsItalic:(BOOL)isItalic;
  445. /**
  446. * Whether the font of the currently selected text block is italic.
  447. */
  448. - (BOOL)isItalicCurrentSelection;
  449. /**
  450. * Sets the currently selected text is bold.
  451. */
  452. - (void)setCurrentSelectionIsBold:(BOOL)isBold;
  453. /**
  454. * Whether the font of the currently selected text block is bold.
  455. */
  456. - (BOOL)isBoldCurrentSelection;
  457. /**
  458. * Create a blank text block.
  459. * @param rect The area of the text box.
  460. * @param attributes The text font properties.
  461. * @param page The created page number.
  462. * @return Returns whether the creation is successful.
  463. */
  464. - (BOOL)createEmptyStringBounds:(CGRect)rect withAttributes:(NSDictionary<NSAttributedStringKey, id> *)attributes page:(CPDFPage *)page;
  465. /**
  466. * Sets text transparency.
  467. */
  468. - (BOOL)setCharsFontTransparency:(float)transparency;
  469. - (CGFloat)getCurrentOpacity;
  470. /**
  471. * Gets the Edit supported font name.
  472. */
  473. - (NSArray*)getFontList;
  474. #pragma mark - Edit Image
  475. /*
  476. * Get the rotation Angle of the picture
  477. */
  478. - (CGFloat)getRotationEditArea:(CPDFEditImageArea*)editArea;
  479. /*
  480. * Sets the rotation angle of image.
  481. */
  482. - (void)rotateEditArea:(CPDFEditImageArea *)editArea rotateAngle:(float)angle;
  483. /*
  484. * Mirrors the image horizontally.
  485. */
  486. - (BOOL)horizontalMirrorEditArea:(CPDFEditImageArea *)editArea;
  487. /*
  488. * Mirrors the image vertically.
  489. */
  490. - (BOOL)verticalMirrorEditArea:(CPDFEditImageArea *)editArea;
  491. /*
  492. * Crops the specified size.
  493. */
  494. - (void)cropEditArea:(CPDFEditImageArea *)editArea withRect:(CGRect)rect;
  495. /*
  496. * Gets the cropped size.
  497. */
  498. - (CGRect)getClipRectEditArea:(CPDFEditImageArea *)editArea;
  499. /*
  500. * Ends cropping.
  501. */
  502. - (void)beginCropEditArea:(CPDFEditImageArea *)editArea;
  503. /*
  504. * End cutting
  505. */
  506. - (void)endCropEditArea:(CPDFEditImageArea *)editArea;
  507. /*
  508. * Extracts the image to the specified path.
  509. */
  510. - (BOOL)extractImageEditArea:(CPDFEditImageArea *)editArea filePath:(NSString*)filePath;
  511. /*
  512. * Extracts the image to the specified path.
  513. */
  514. - (BOOL)extractImageWithEditImageArea:(CPDFEditArea *)editArea;
  515. /*
  516. * Gets image transparency.
  517. */
  518. - (float)getImageTransparencyEditArea:(CPDFEditImageArea *)editArea;
  519. /*
  520. * Sets image transparency.
  521. */
  522. - (BOOL)setImageTransparencyEditArea:(CPDFEditImageArea *)editArea transparency:(float)transparency;
  523. /*
  524. * Adds interface of the image.
  525. */
  526. - (BOOL)createEmptyImage:(CGRect)rect page:(CPDFPage *)page path:(NSString*)imagePath;
  527. /*
  528. * Replace of the image.
  529. */
  530. - (BOOL)replaceEditImageArea:(CPDFEditImageArea *)editArea imagePath:(NSString *)imagePath;
  531. @end