Browse Source

PDFTools(iOS) - 编辑操作逻辑完善

chenyu 1 year ago
parent
commit
887497c7cd

+ 35 - 0
compdfkit-tools/compdfkit-tools/Edit/CPDFEditCell/CPDFEditFontNameSelectView.h

@@ -0,0 +1,35 @@
+//
+//  CPDFEditFontNameSelectView.h
+//  compdfkit-tools
+//
+//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
+//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
+//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
+//
+
+
+#import <UIKit/UIKit.h>
+
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class CPDFEditFontNameSelectView;
+
+@protocol CPDFEditFontNameSelectViewDelegate <NSObject>
+
+@optional
+
+- (void)pickerView:(CPDFEditFontNameSelectView *)colorPickerView fontName:(NSString *)fontName;
+
+@end
+
+
+@interface CPDFEditFontNameSelectView : UIView
+
+@property (nonatomic, strong) NSString *fontName;
+
+@property (nonatomic, weak) id<CPDFEditFontNameSelectViewDelegate> delegate;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 107 - 0
compdfkit-tools/compdfkit-tools/Edit/CPDFEditCell/CPDFEditFontNameSelectView.m

@@ -0,0 +1,107 @@
+//
+//  CPDFEditFontNameSelectView.m
+//  compdfkit-tools
+//
+//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
+//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
+//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
+//
+
+
+#import "CPDFEditFontNameSelectView.h"
+#import <ComPDFKit/ComPDFKit.h>
+
+@interface CPDFEditFontNameSelectView()<UITableViewDelegate,UITableViewDataSource>
+
+@property (nonatomic, strong) UILabel *titleLabel;
+
+@property (nonatomic, strong) UIButton *backBtn;
+
+@property (nonatomic, strong) UITableView *mTableView;
+
+@property (nonatomic, copy)   NSString * selectedFontName;
+
+@property (nonatomic, strong) NSMutableArray * fontNameArr;
+
+
+@end
+
+@implementation CPDFEditFontNameSelectView
+
+- (instancetype)initWithFrame:(CGRect)frame {
+    if (self == [super initWithFrame:frame]) {
+        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake((self.frame.size.width - 120)/2, 0, 120, (self.bounds.size.height - 40)/6)];
+        _titleLabel.text = NSLocalizedString(@"Font Name", nil);
+        _titleLabel.autoresizingMask  = UIViewAutoresizingFlexibleHeight;
+        [self addSubview:self.titleLabel];
+        
+        _backBtn = [[UIButton alloc] initWithFrame:CGRectMake(10, 0, 40, (self.bounds.size.height - 40)/6)];
+        _backBtn.autoresizingMask = UIViewAutoresizingFlexibleHeight;
+        [_backBtn setImage:[UIImage imageNamed:@"CPDFAnnotationBarImageUndo" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+        [_backBtn addTarget:self action:@selector(buttonItemClicked_back:) forControlEvents:UIControlEventTouchUpInside];
+        [self addSubview:self.backBtn];
+        
+        if(!self.fontNameArr) {
+            self.fontNameArr = [[NSMutableArray alloc] initWithObjects:@"FontName1",@"fontName2",@"fontName3",nil];
+        }
+        
+    }
+    return self;
+}
+
+- (void)layoutSubviews {
+    [super layoutSubviews];
+    
+    if(!self.mTableView){
+        self.mTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.titleLabel.frame), self.frame.size.width, self.frame.size.height - self.titleLabel.frame.size.height)];
+        self.mTableView.delegate = self;
+        [self addSubview:self.mTableView];
+        
+        self.mTableView.delegate = self;
+        self.mTableView.dataSource = self;
+        [self.mTableView reloadData];
+    }
+}
+
+#pragma mark - Private Methods
+
+#pragma mark - Action
+
+- (void)buttonItemClicked_back:(id)sender {
+    [self removeFromSuperview];
+    if (self.delegate && [self.delegate respondsToSelector:@selector(pickerView:fontName:)]) {
+        [self.delegate pickerView:self fontName:self.selectedFontName];
+    }
+}
+
+#pragma mark - UItableViewDeleagte && UITableViewDataSource
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+    return self.fontNameArr.count;
+}
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+    static NSString * cellIdentity = @"fontNameSelectCell";
+    
+    UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:cellIdentity];
+    if(!cell){
+        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentity];
+    }
+    cell.textLabel.text = self.fontNameArr[indexPath.row];
+    cell.accessoryType  = UITableViewCellAccessoryNone;
+    return cell;
+}
+
+
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
+    
+    [tableView reloadData];
+    UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
+    cell.accessoryType = UITableViewCellAccessoryCheckmark;
+    self.selectedFontName = self.fontNameArr[indexPath.row];
+}
+
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
+    return 60;
+}
+
+@end

+ 10 - 0
compdfkit-tools/compdfkit-tools/Edit/CPDFEditCell/CPDFImagePropertyCell.m

@@ -34,4 +34,14 @@
     // Configure the view for the selected state
 }
 
+#pragma mark - Action
+- (IBAction)horizontalAction:(UIButton *)sender {
+    sender.selected = !sender.selected;
+}
+
+- (IBAction)verticalAction:(UIButton *)sender{
+    sender.selected = !sender.selected;
+}
+
+
 @end

+ 34 - 24
compdfkit-tools/compdfkit-tools/Edit/CPDFEditCell/CPDFImagePropertyCell.xib

@@ -48,71 +48,79 @@
                         <nil key="highlightedColor"/>
                     </label>
                     <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="who-Mn-OKt">
-                        <rect key="frame" x="40" y="122" width="40" height="40"/>
+                        <rect key="frame" x="40" y="122" width="20" height="20"/>
                         <constraints>
-                            <constraint firstAttribute="height" constant="40" id="Idy-1W-f5K"/>
-                            <constraint firstAttribute="width" constant="40" id="QDn-V1-uwc"/>
+                            <constraint firstAttribute="height" constant="20" id="Idy-1W-f5K"/>
+                            <constraint firstAttribute="width" constant="20" id="QDn-V1-uwc"/>
                         </constraints>
                         <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                         <state key="normal" title="Horenzatol" image="CPDFEditHorizontalFlip"/>
+                        <state key="selected" image="CPDFEditHorizontalFlipH"/>
+                        <connections>
+                            <action selector="horizontalAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="Ukp-fi-UAD"/>
+                        </connections>
                     </button>
                     <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="dA7-GZ-Kj2">
-                        <rect key="frame" x="273" y="122" width="40" height="40"/>
+                        <rect key="frame" x="283" y="122" width="20" height="20"/>
                         <constraints>
-                            <constraint firstAttribute="height" constant="40" id="CNq-lR-FHm"/>
-                            <constraint firstAttribute="width" constant="40" id="roA-1F-HDF"/>
+                            <constraint firstAttribute="height" constant="20" id="3Gu-wZ-xww"/>
+                            <constraint firstAttribute="width" constant="20" id="b86-2o-gr7"/>
                         </constraints>
                         <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                         <state key="normal" title="Button" image="CPDFEditVerticalFlip"/>
+                        <state key="selected" image="CPDFEditVerticalFlipH"/>
+                        <connections>
+                            <action selector="verticalAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="Ago-No-A24"/>
+                        </connections>
                     </button>
                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Image Transparency:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="KHd-Dh-MMI">
-                        <rect key="frame" x="40" y="182" width="159" height="21"/>
+                        <rect key="frame" x="40" y="162" width="159" height="21"/>
                         <fontDescription key="fontDescription" type="system" pointSize="17"/>
                         <nil key="textColor"/>
                         <nil key="highlightedColor"/>
                     </label>
                     <slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.5" minValue="0.0" maxValue="1" translatesAutoresizingMaskIntoConstraints="NO" id="7i1-sQ-oZ3">
-                        <rect key="frame" x="38" y="213" width="118" height="34"/>
+                        <rect key="frame" x="38" y="193" width="118" height="34"/>
                     </slider>
                     <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Tru-zG-DMC">
-                        <rect key="frame" x="231.66666666666666" y="213" width="81.333333333333343" height="35"/>
+                        <rect key="frame" x="231.66666666666666" y="193" width="81.333333333333343" height="35"/>
                         <state key="normal" title="Button"/>
                         <buttonConfiguration key="configuration" style="plain" title="Vertical"/>
                     </button>
                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Replace image:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="A5n-Aq-3ze">
-                        <rect key="frame" x="39.999999999999993" y="276" width="116.33333333333331" height="21"/>
+                        <rect key="frame" x="39.999999999999993" y="256" width="116.33333333333331" height="21"/>
                         <fontDescription key="fontDescription" type="system" pointSize="17"/>
                         <nil key="textColor"/>
                         <nil key="highlightedColor"/>
                     </label>
                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="image export:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Zt5-QF-WOf">
-                        <rect key="frame" x="39.999999999999993" y="328" width="104.33333333333331" height="21"/>
+                        <rect key="frame" x="39.999999999999993" y="308" width="104.33333333333331" height="21"/>
                         <fontDescription key="fontDescription" type="system" pointSize="17"/>
                         <nil key="textColor"/>
                         <nil key="highlightedColor"/>
                     </label>
                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="qhu-MQ-xkY">
-                        <rect key="frame" x="40" y="359" width="283" height="1"/>
+                        <rect key="frame" x="40" y="339" width="283" height="1"/>
                         <color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                     </view>
                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="image crop:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Iar-AU-dds">
-                        <rect key="frame" x="40" y="380" width="90" height="21"/>
+                        <rect key="frame" x="40" y="360" width="90" height="21"/>
                         <fontDescription key="fontDescription" type="system" pointSize="17"/>
                         <nil key="textColor"/>
                         <nil key="highlightedColor"/>
                     </label>
                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="QeB-oD-MRy">
-                        <rect key="frame" x="40" y="411" width="283" height="1"/>
+                        <rect key="frame" x="40" y="391" width="283" height="1"/>
                         <color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                     </view>
                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="image add:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="49a-VY-aZG">
-                        <rect key="frame" x="39.999999999999993" y="432" width="84.333333333333314" height="21"/>
+                        <rect key="frame" x="39.999999999999993" y="412" width="84.333333333333314" height="21"/>
                         <fontDescription key="fontDescription" type="system" pointSize="17"/>
                         <nil key="textColor"/>
                         <nil key="highlightedColor"/>
                     </label>
                     <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="epi-iZ-bX6">
-                        <rect key="frame" x="268" y="274" width="25" height="25"/>
+                        <rect key="frame" x="268" y="254" width="25" height="25"/>
                         <constraints>
                             <constraint firstAttribute="width" constant="25" id="0rZ-eT-S4g"/>
                             <constraint firstAttribute="height" constant="25" id="BoC-AB-HkH"/>
@@ -121,7 +129,7 @@
                         <state key="normal" image="CPDFEditImageDefault"/>
                     </button>
                     <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ce0-Af-lyc">
-                        <rect key="frame" x="268" y="326" width="25" height="25"/>
+                        <rect key="frame" x="268" y="306" width="25" height="25"/>
                         <constraints>
                             <constraint firstAttribute="width" constant="25" id="HlN-cm-iL6"/>
                             <constraint firstAttribute="height" constant="25" id="mg7-ZO-ZTM"/>
@@ -130,7 +138,7 @@
                         <state key="normal" image="CPDFEditExport"/>
                     </button>
                     <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="x97-GO-glq">
-                        <rect key="frame" x="268" y="378" width="25" height="25"/>
+                        <rect key="frame" x="268" y="358" width="25" height="25"/>
                         <constraints>
                             <constraint firstAttribute="width" constant="25" id="JlN-Ah-6bW"/>
                             <constraint firstAttribute="height" constant="25" id="VCo-qW-HOp"/>
@@ -139,7 +147,7 @@
                         <state key="normal" image="CPDFEditCrop"/>
                     </button>
                     <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="qv3-jL-TFl">
-                        <rect key="frame" x="268" y="430" width="25" height="25"/>
+                        <rect key="frame" x="268" y="410" width="25" height="25"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="25" id="ayC-By-kJg"/>
                             <constraint firstAttribute="width" constant="25" id="jOE-2B-Rb6"/>
@@ -148,7 +156,7 @@
                         <state key="normal" image="CPDFEditAdd"/>
                     </button>
                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="S1c-pL-3pg">
-                        <rect key="frame" x="40" y="307" width="283" height="1"/>
+                        <rect key="frame" x="40" y="287" width="283" height="1"/>
                         <color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="1" id="x36-UJ-jKZ"/>
@@ -162,7 +170,6 @@
                     <constraint firstItem="n2j-U4-BXE" firstAttribute="top" secondItem="aRx-DE-HGO" secondAttribute="bottom" constant="10" id="38m-hu-VhR"/>
                     <constraint firstItem="S1c-pL-3pg" firstAttribute="top" secondItem="A5n-Aq-3ze" secondAttribute="bottom" constant="10" id="3Eh-Ot-Aj5"/>
                     <constraint firstItem="Iar-AU-dds" firstAttribute="leading" secondItem="Zt5-QF-WOf" secondAttribute="leading" id="5vO-p9-eas"/>
-                    <constraint firstItem="dA7-GZ-Kj2" firstAttribute="top" secondItem="who-Mn-OKt" secondAttribute="top" id="6S1-fn-puM"/>
                     <constraint firstItem="Tru-zG-DMC" firstAttribute="top" secondItem="7i1-sQ-oZ3" secondAttribute="top" id="6bn-b5-aKo"/>
                     <constraint firstItem="QeB-oD-MRy" firstAttribute="top" secondItem="Iar-AU-dds" secondAttribute="bottom" constant="10" id="6dW-5u-uxX"/>
                     <constraint firstItem="qhu-MQ-xkY" firstAttribute="height" secondItem="S1c-pL-3pg" secondAttribute="height" id="6ka-2Y-ybh"/>
@@ -174,7 +181,6 @@
                     <constraint firstAttribute="trailing" secondItem="QIY-I8-jze" secondAttribute="trailing" constant="40" id="Ffu-Oz-9W9"/>
                     <constraint firstItem="x97-GO-glq" firstAttribute="trailing" secondItem="ce0-Af-lyc" secondAttribute="trailing" id="Gwm-rY-awS"/>
                     <constraint firstItem="qv3-jL-TFl" firstAttribute="trailing" secondItem="x97-GO-glq" secondAttribute="trailing" id="HHE-Xf-4i6"/>
-                    <constraint firstAttribute="trailing" secondItem="dA7-GZ-Kj2" secondAttribute="trailing" constant="40" id="HW6-9G-yPo"/>
                     <constraint firstItem="ce0-Af-lyc" firstAttribute="centerY" secondItem="Zt5-QF-WOf" secondAttribute="centerY" id="HuH-80-54R"/>
                     <constraint firstItem="qhu-MQ-xkY" firstAttribute="trailing" secondItem="S1c-pL-3pg" secondAttribute="trailing" id="I9c-YO-qlv"/>
                     <constraint firstItem="Zt5-QF-WOf" firstAttribute="top" secondItem="S1c-pL-3pg" secondAttribute="bottom" constant="20" id="IQc-1I-ypq"/>
@@ -189,6 +195,7 @@
                     <constraint firstAttribute="trailing" secondItem="Tru-zG-DMC" secondAttribute="trailing" constant="40" id="PvU-B2-Dyx"/>
                     <constraint firstItem="epi-iZ-bX6" firstAttribute="centerY" secondItem="A5n-Aq-3ze" secondAttribute="centerY" id="RB7-P9-5Dj"/>
                     <constraint firstItem="7i1-sQ-oZ3" firstAttribute="width" secondItem="H2p-sc-9uM" secondAttribute="width" multiplier="0.322946" id="S3Y-Tv-J9H"/>
+                    <constraint firstAttribute="trailing" secondItem="dA7-GZ-Kj2" secondAttribute="trailing" constant="50" id="Tcj-yM-Vgh"/>
                     <constraint firstItem="qhu-MQ-xkY" firstAttribute="leading" secondItem="S1c-pL-3pg" secondAttribute="leading" id="V8m-tZ-Opj"/>
                     <constraint firstItem="ce0-Af-lyc" firstAttribute="trailing" secondItem="epi-iZ-bX6" secondAttribute="trailing" id="WWx-QQ-ZZ6"/>
                     <constraint firstItem="Iar-AU-dds" firstAttribute="top" secondItem="qhu-MQ-xkY" secondAttribute="bottom" constant="20" id="X6E-RU-TNc"/>
@@ -202,6 +209,7 @@
                     <constraint firstItem="2Bf-8k-BNs" firstAttribute="leading" secondItem="aRx-DE-HGO" secondAttribute="leading" id="tXf-ye-V5v"/>
                     <constraint firstItem="A5n-Aq-3ze" firstAttribute="leading" secondItem="7i1-sQ-oZ3" secondAttribute="leading" id="vsd-5T-HV6"/>
                     <constraint firstAttribute="trailingMargin" secondItem="epi-iZ-bX6" secondAttribute="trailing" constant="40" id="xNF-Ii-j9S"/>
+                    <constraint firstItem="dA7-GZ-Kj2" firstAttribute="centerY" secondItem="who-Mn-OKt" secondAttribute="centerY" id="xho-IX-goR"/>
                     <constraint firstItem="n2j-U4-BXE" firstAttribute="leading" secondItem="aRx-DE-HGO" secondAttribute="leading" id="yeV-4n-cWP"/>
                 </constraints>
             </tableViewCellContentView>
@@ -213,10 +221,12 @@
         <image name="CPDFEditAdd" width="26" height="26"/>
         <image name="CPDFEditCrop" width="26" height="25"/>
         <image name="CPDFEditExport" width="25" height="25"/>
-        <image name="CPDFEditHorizontalFlip" width="41" height="41"/>
+        <image name="CPDFEditHorizontalFlip" width="21" height="21"/>
+        <image name="CPDFEditHorizontalFlipH" width="21" height="21"/>
         <image name="CPDFEditIRotate" width="41" height="41"/>
         <image name="CPDFEditImageDefault" width="20" height="21"/>
         <image name="CPDFEditRRotate" width="41" height="41"/>
-        <image name="CPDFEditVerticalFlip" width="41" height="41"/>
+        <image name="CPDFEditVerticalFlip" width="21" height="21"/>
+        <image name="CPDFEditVerticalFlipH" width="21" height="21"/>
     </resources>
 </document>

+ 7 - 1
compdfkit-tools/compdfkit-tools/Edit/CPDFEditCell/CPDFTextPropertyCell.m

@@ -13,7 +13,7 @@
 #import "CPDFOpacitySliderView.h"
 #import "CPDFColorPickerView.h"
 
-@interface CPDFTextPropertyCell()<CPDFColorSelectViewDelegate>
+@interface CPDFTextPropertyCell()<CPDFColorSelectViewDelegate,CPDFOpacitySliderViewDelegate>
 @property (weak, nonatomic) IBOutlet UIView *colorAreaView;
 @property (nonatomic, strong) CPDFColorSelectView * colorView;
 @property (weak, nonatomic) IBOutlet UIView *sliderArea;
@@ -53,6 +53,7 @@
         self.opacityView.titleLabel.text = NSLocalizedString(@"Font Size:", nil);
         self.opacityView.startLabel.text = @"0";
         self.opacityView.endLabel.text = @"100";
+        self.opacityView.delegate = self;
         [self.sliderArea addSubview:self.opacityView];
     }
     
@@ -74,6 +75,11 @@
 - (void)selectColorView:(CPDFColorSelectView *)select color:(UIColor *)color {
 }
 
+#pragma mark - OPacitySliderView
+- (void)opacitySliderView:(CPDFOpacitySliderView *)opacitySliderView opacity:(CGFloat)opacity {
+    NSLog(@"Opacity Slider! opacity%f",opacity);
+}
+
 #pragma mark - Action
 
 - (IBAction)fontBoldAction:(UIButton *)sender {