CPDFView.h 19 KB

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