-
Notifications
You must be signed in to change notification settings - Fork 0
/
PDFKit.framework.h
2094 lines (1618 loc) · 107 KB
/
PDFKit.framework.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// ========== PDFKit.framework/Headers/PDFAnnotation.h
//
// PDFAnnotation.h
// Copyright © 2019 Apple. All rights reserved.
//
// PDFAnnotation is a wrapper class of all annotation types for a PDF document.
// It is a container of key-value pairs that map directly to the PDF file format, defined
// in the Adobe PDF Specification (file format version 1.7). You can manipulate
// properties of an annotation by either assigning key-value pairs, where keys are always
// strings defined in the specification and listed below (example: PDFAnnotationKeyFlags).
// You can also replace existing key-values in the PDFAnnotation dictionary, or remove them.
// Value types vary based on what the key is. For example, the value for a color key can either
// be an array of numbers (0 for no color, 1 for gray, 3 for RGB, 4 for CMYK) or can be an
// NSColor or UIColor instance. Some keys require complex values, typically as an array or
// dictionaries of objects. PDFKit provides some classes as a convenience for these complex
// type: PDFBorder, PDFAction (its subclasses), PDFDestination. Note that there are also
// helper category functions that are specialized for many of the legacy PDFAnnotation
// subclasses. You can find this in PDFAnnotationUtilities.h
//
// Note that the preferred constructor for PDFAnnotation is -[initWithBounds:forType:withProperties:],
// and at a minimum you must set bounds and type for the annotation. Calling -[init] will raise an
// exception. To add an annotation to a page, you must do so via -[PDFPage addAnnotation:] on your
// desired page. You may not change annotation subtype at runtime. If you want to change annotation
// subtype, remove the annotation and add a new instance. If you use the deprecated constructor
// -[initWithBounds:], you may set the annotation subtype only once. Any future assignments of subtype
// will be ignored and produce a warning.
//
// Note that PDFAnnotation can render any annotation with a content-stream entry in the annotation's
// dictionary, though some are supported natively based on their annotation dictionary. Supported
// annotations have their subtype declared via NSString defined in PDFAnnotationUtilities.h
// using the naming convention "PDFAnnotationSubtypeX", where X is the subtype. Those not in
// this list will only draw if there is an appearance stream.
//
// Adobe PDF Specification (1.7) defines in Table 8.15 "Entries common to all annotation
// dictionaries" 14 common properties among all annotations. 2-4 are required, the rest are
// optional. PDFKit supports 13 of these annotations. For all common properties and each
// annotation's specific properties, we define them as enumerations and enum-mapped strings at
// the top of this file.
//
// You can activate logging of any annotation key-value assignments that fails by setting the
// environment variable "PDFKIT_LOG_ANNOTATIONS" to any value.
//
#import <PDFKit/PDFKitPlatform.h>
#import <PDFKit/PDFPage.h>
#import <PDFKit/PDFAction.h>
NS_ASSUME_NONNULL_BEGIN
// All PDF annotation subtypes that PDFKit can render: based on Adobe PDF specification, Table 8.20: Annotation types.
// Annotation subtypes not supported: Polygon, PolyLine, Squiggly, Caret, Caret, FileAttachment,
// Sound, Movie, Screen, PrinterMark, TrapNet, Watermark, 3D, Rect.
typedef NSString* const PDFAnnotationSubtype NS_STRING_ENUM;
// Common keys used for all annotations
// Adobe PDF Specification (1.7), Table 8.15: Entries common to all annotation dictionaries
typedef NSString* const PDFAnnotationKey NS_STRING_ENUM;
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyAppearanceDictionary PDFKIT_AVAILABLE(10_13, 11_0); // "/AP": Dictionary
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyAppearanceState PDFKIT_AVAILABLE(10_13, 11_0); // "/AS": Name
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyBorder PDFKIT_AVAILABLE(10_13, 11_0); // "/Border": Array of Integers; or a PDFBorder object
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyColor PDFKIT_AVAILABLE(10_13, 11_0); // "/C": Array of Floats; or a PDFKitPlatformColor object
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyContents PDFKIT_AVAILABLE(10_13, 11_0); // "/Contents": String
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyFlags PDFKIT_AVAILABLE(10_13, 11_0); // "/F": Integer
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyDate PDFKIT_AVAILABLE(10_13, 11_0); // "/M": Date or String
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyName PDFKIT_AVAILABLE(10_13, 11_0); // "/NM": String
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyPage PDFKIT_AVAILABLE(10_13, 11_0); // "/P": Dictionary; or a PDFPage object.
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyRect PDFKIT_AVAILABLE(10_13, 11_0); // "/Rect": CGRect
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeySubtype PDFKIT_AVAILABLE(10_13, 11_0); // "/Subtype": Name (See Table 8.20: Annotation types)
// Additional annotation extensions...
// Adobe PDF Specification (1.7), Table 8.23: Additional entries specific to a text annotation
// Adobe PDF Specification (1.7), Table 8.24: Additional entries specific to a link annotation
// Adobe PDF Specification (1.7), Table 8.25: Additional entries specific to a free text annotation
// Adobe PDF Specification (1.7), Table 8.26: Additional entries specific to a line annotation
// Adobe PDF Specification (1.7), Table 8.28: Additional entries specific to a square or circle annotation
// Adobe PDF Specification (1.7), Table 8.30: Additional entries specific to text markup annotations (highlight, underline, strikeout)
// Adobe PDF Specification (1.7), Table 8.32: Additional entries specific to a rubber stamp annotation
// Adobe PDF Specification (1.7), Table 8.33: Additional entries specific to an ink annotation
// Adobe PDF Specification (1.7), Table 8.34: Additional entries specific to a pop-up annotation
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyAction PDFKIT_AVAILABLE(10_13, 11_0); // "/A": Dictionary; or a PDFAction object
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyAdditionalActions PDFKIT_AVAILABLE(10_13, 11_0); // "/AA": Dictionary; or a PDFAction object
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyBorderStyle PDFKIT_AVAILABLE(10_13, 11_0); // "/BS": Dictionary
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyDefaultAppearance PDFKIT_AVAILABLE(10_13, 11_0); // "/DA": String
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyDestination PDFKIT_AVAILABLE(10_13, 11_0); // "/Dest": Array, Name, or String
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyHighlightingMode PDFKIT_AVAILABLE(10_13, 11_0); // "/H": Name
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyInklist PDFKIT_AVAILABLE(10_13, 11_0); // "/Inklist": Array of Arrays (each array representing a stroked path)
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyInteriorColor PDFKIT_AVAILABLE(10_13, 11_0); // "/IC": Array of Floats; or a PDFKitPlatformColor object
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyLinePoints PDFKIT_AVAILABLE(10_13, 11_0); // "/L": Array of Floats
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyLineEndingStyles PDFKIT_AVAILABLE(10_13, 11_0); // "/LE": Array of Strings
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyIconName PDFKIT_AVAILABLE(10_13, 11_0); // "/Name": Name
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyOpen PDFKIT_AVAILABLE(10_13, 11_0); // "/Open": Boolean
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyParent PDFKIT_AVAILABLE(10_13, 11_0); // "/Parent": Dictionary; or a PDFAnnotation object
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyPopup PDFKIT_AVAILABLE(10_13, 11_0); // "/Popup": Dictionary; or a PDFAnnotation object of type "Popup"
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyQuadding PDFKIT_AVAILABLE(10_13, 11_0); // "/Q": Integer
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyQuadPoints PDFKIT_AVAILABLE(10_13, 11_0); // "/QuadPoints": Array of Floats
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyTextLabel PDFKIT_AVAILABLE(10_13, 11_0); // "/T": String
// Widget annotation extensions
// Adobe PDF Specification (1.7), Table 8.39: Additional entries specific to a widget annotation
// Adobe PDF Specification (1.7), Table 8.40: Entries in an appearance characteristics dictionary
// Adobe PDF Specification (1.7), Table 8.69: Entries common to all field dictionaries
// Adobe PDF Specification (1.7), Table 8.76: Additional entry specific to check box and radio button fields
// Adobe PDF Specification (1.7), Table 8.78: Additional entry specific to a text field
// Adobe PDF Specification (1.7), Table 8.80: Additional entries specific to a choice field
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyWidgetDownCaption PDFKIT_AVAILABLE(10_13, 11_0); // "/AC": String
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyWidgetBorderColor PDFKIT_AVAILABLE(10_13, 11_0); // "/BC": Array of Floats; or a PDFKitPlatformColor object
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyWidgetBackgroundColor PDFKIT_AVAILABLE(10_13, 11_0); // "/BG": Array of Floats; or a PDFKitPlatformColor object
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyWidgetCaption PDFKIT_AVAILABLE(10_13, 11_0); // "/CA": String
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyWidgetDefaultValue PDFKIT_AVAILABLE(10_13, 11_0); // "/DV": (various)
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyWidgetFieldFlags PDFKIT_AVAILABLE(10_13, 11_0); // "/Ff": Integer
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyWidgetFieldType PDFKIT_AVAILABLE(10_13, 11_0); // "/FT": Name
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyWidgetAppearanceDictionary PDFKIT_AVAILABLE(10_13, 11_0); // "/MK": Dictionary; or PDFAppearanceCharacteristics object
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyWidgetMaxLen PDFKIT_AVAILABLE(10_13, 11_0); // "/MaxLen": Integer
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyWidgetOptions PDFKIT_AVAILABLE(10_13, 11_0); // "/Opt": Array (each element is either a string, or an array of two strings)
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyWidgetRotation PDFKIT_AVAILABLE(10_13, 11_0); // "/R": Integer
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyWidgetRolloverCaption PDFKIT_AVAILABLE(10_13, 11_0); // "/RC": String
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyWidgetTextLabelUI PDFKIT_AVAILABLE(10_13, 11_0); // "/TU": String
PDFKIT_EXTERN PDFAnnotationKey PDFAnnotationKeyWidgetValue PDFKIT_AVAILABLE(10_13, 11_0); // "/V": (various)
@class PDFAction, PDFBorder, PDFPage, PDFAnnotationPopup, PDFAnnotationPrivateVars;
PDFKIT_CLASS_AVAILABLE(10_4, 11_0)
@interface PDFAnnotation : NSObject <NSCopying, NSCoding>
{
@private
PDFAnnotationPrivateVars *_private;
}
// This is the base class for all annotations. A PDFAnnotation object by itself is not useful, only subclasses (like
// PDFAnnotationCircle, PDFAnnotationText) are interesting. In parsing a PDF however, any unknown or unsupported
// annotations will be represented as this base class.
// -------- initializer
// Create a custom annotation with bounds, a type (PDFAnnotationSubtype), and an (optional) dictionary of annotation properties.
- (instancetype)initWithBounds:(PDFRect)bounds forType:(PDFAnnotationSubtype)annotationType withProperties:(nullable NSDictionary*)properties PDFKIT_AVAILABLE(10_13, 11_0) NS_DESIGNATED_INITIALIZER;
// -------- accessors
// Returns the page the annotation is associated with (may return nil if annotation not associated with a page).
@property (nonatomic, weak, nullable) PDFPage *page;
// Returns the annotation type (called "Subtype" in the PDF specification since "Annot" is the type). Examples include:
// "Text", "Link", "Line", etc. Required. Note that you are only allowed to set the type of an annotation once.
@property (nonatomic, copy, nullable) NSString *type;
// Required for all annotations. The bounding box in page-space of the annotation.
@property (nonatomic) PDFRect bounds;
// Indicates whether the annotation should be displayed on screen (depending upon -[shouldPrint] it may still print).
@property (nonatomic) BOOL shouldDisplay;
// Indicates whether the annotation should be printed or not.
@property (nonatomic) BOOL shouldPrint;
// Optional (-[modificationDate] may return nil). Modification date of the annotation.
@property (nonatomic, copy, nullable) NSDate *modificationDate PDFKIT_AVAILABLE(10_5, 11_0);
// Optional (-[userName] may return nil). Name of the user who created the annotation.
@property (nonatomic, copy, nullable) NSString *userName PDFKIT_AVAILABLE(10_5, 11_0);
// Optional (-[popup] may return nil). Not used with links or widgets, a popup annotation associated with this
// annotation. The bounds and open state of the popup indicate the placement and open state of the popup window.
@property (nonatomic, strong, nullable) PDFAnnotation *popup PDFKIT_AVAILABLE(10_5, 11_0);
// Optional border or border style that describes how to draw the annotation border (if any). For the "geometry"
// annotations (Circle, Ink, Line, Square), the border indicates the line width and whether to draw with a dash pattern
// or solid pattern. PDFAnnotation markup types (Highlight, Strikethrough, Underline) ignores the border.
@property (nonatomic, strong, nullable) PDFBorder *border PDFKIT_AVAILABLE(10_4, 11_0);
// For many annotations ("Circle", "Square") the stroke color. Used for other annotations as well.
@property (nonatomic, copy) PDFKitPlatformColor *color PDFKIT_AVAILABLE(10_4, 11_0);
// A string of text associated with an annotation. Often displayed in a window when the annotation is clicked on
// ("FreeText" and "Text" especially).
@property (nonatomic, copy, nullable) NSString *contents PDFKIT_AVAILABLE(10_5, 11_0);
// Optional action performed when a user clicks / taps an annotation. PDF readers ignore actions except
// for those associated with Link or button Widget annotations.
@property (nonatomic, strong, nullable) PDFAction *action PDFKIT_AVAILABLE(10_5, 11_0);
// Returns YES if the annotation has an appearance stream. Annotations with appearance streams are drawn using their
// stream. As a result setting many parameters (like -[setColor:] above) will have no visible effect.
@property (nonatomic, readonly) BOOL hasAppearanceStream;
// The highlight state dictates how the annotation is drawn. For example, if a user has clicked on a
// "Link" annotation, you should set highlighted to YES and redraw it. When the user lets up, set highlighted to
// NO and redraw again.
@property (nonatomic, getter=isHighlighted) BOOL highlighted PDFKIT_AVAILABLE(10_13, 11_0);
// -------- drawing
// Draw method. Draws in page-space relative to origin of "box" passed in and to the given context
- (void)drawWithBox:(PDFDisplayBox)box inContext:(CGContextRef)context PDFKIT_AVAILABLE(10_12, 11_0);
// -------- attribute mutations
// Allows you to set a key-value pair in this annotation's dictionary. Returns true on successful
// assignment, false on error. Key must be valid for a PDF annotation's object type, and must have
// a value that is acceptable for the key type. These values can either be an NSString, NSNumber,
// NSArray of strings or numbers, or an NSDictionary of the previously listed types. Some keys expect
// a complex type, for example the key "/C" expects a color in the format of an array of 0, 1, 3,
// or 4 elements, with each element being a floating-point number in the range of 0.0 - 1.0 ). As
// a convenience, these kind of keys will directly accept NSColor / UIColor values. Other convenience
// functions provide similar support can be found in PDFAnnotationUtilities header file. Note that you
// can set the environment variable "PDFKIT_LOG_ANNOTATIONS" to log any key-value assignment failures.
- (BOOL)setValue:(id)value forAnnotationKey:(PDFAnnotationKey)key PDFKIT_AVAILABLE(10_12, 11_0);
- (BOOL)setBoolean:(BOOL)value forAnnotationKey:(PDFAnnotationKey)key PDFKIT_AVAILABLE(10_12, 11_0);
- (BOOL)setRect:(PDFRect)value forAnnotationKey:(PDFAnnotationKey)key PDFKIT_AVAILABLE(10_12, 11_0);
// List all key-value pairs for this annotation; returns a deep copy of all pairs.
// Note that this method will not include a copy of the value for /Parent. This is by design as to avoid
// introduing a memory cycle. If you would like to get the /Parent propery, use -[PDFAnnotation valueForAnnotationKey:]
// with key PDFAnnotationKeyParent.
@property (nonatomic, readonly, copy) NSDictionary *annotationKeyValues PDFKIT_AVAILABLE(10_13, 11_0);
// Retrieves a deep copy of the key-value pair based on the given key; key can either be
// from the keys PDFAnnotationKey, or an appropriate string from the PDF specification.
- (nullable id)valueForAnnotationKey:(PDFAnnotationKey)key PDFKIT_AVAILABLE(10_12, 11_0);
// Remove the key-value pair from the annotation dictionary. Returns true on successful removal.
- (void)removeValueForAnnotationKey:(PDFAnnotationKey)key PDFKIT_AVAILABLE(10_12, 11_0);
@end
NS_ASSUME_NONNULL_END
// ========== PDFKit.framework/Headers/PDFActionResetForm.h
//
// PDFActionResetForm.h
// Copyright © 2019 Apple. All rights reserved.
//
// PDFActionResetForm is an interaction event tied with an annotation. This action
// allows a user to reset all form fields (associated by their fieldNames) annotations.
// Form field annotations are typically widget-type annotations.
//
#import <PDFKit/PDFKitPlatform.h>
#import <PDFKit/PDFAction.h>
NS_ASSUME_NONNULL_BEGIN
@class PDFActionResetFormPrivateVars;
PDFKIT_CLASS_AVAILABLE(10_5, 11_0)
@interface PDFActionResetForm : PDFAction <NSCopying>
{
@private
PDFActionResetFormPrivateVars *_private2;
}
// Initially there will be no fields, and -[fieldsIncludedAreCleared] will be YES.
- (instancetype)init NS_DESIGNATED_INITIALIZER;
// Fields are an array of NSString objects corresponding to the fieldNames of Widget annotations on the page.
// May return nil.
@property (nonatomic, copy, nullable) NSArray<NSString*> *fields;
// If -[fieldsIncludedAreCleared] is YES, then the widget annotations associated with the fieldNames in the fields
// array above are to be cleared, i.e. uncheck checkboxes, clear text fields, reset radio buttons, etc.
// If -[fieldsIncludedAreCleared] is NO, then every widget annotation associated with the fields array is not to be
// cleared, meaning that every widget annotation in the document whose field name is not listed is to be cleared.
// Both situations above only occur when this reset-form action is performed.
@property (nonatomic) BOOL fieldsIncludedAreCleared;
@end
NS_ASSUME_NONNULL_END
// ========== PDFKit.framework/Headers/PDFAction.h
//
// PDFAction.h
// Copyright © 2019 Apple. All rights reserved.
//
// PDFAction is an abstract class, representing an event a user can trigger through
// interaction with the owning annotation. These events are PDFActionGoTo, PDFActionNamed,
// PDFActionRemoveGoTo, PDFActionResetForm, and PDFActionURL. Typically these events
// are for moving the PDFView view-portal, open a web browser, clear out forms, etc.
//
#import <PDFKit/PDFKitPlatform.h>
NS_ASSUME_NONNULL_BEGIN
@class PDFActionPrivate;
PDFKIT_CLASS_AVAILABLE(10_5, 11_0)
@interface PDFAction : NSObject <NSCopying>
{
@private
PDFActionPrivate *_private;
}
// Type of action. These won't always correspond to the PDFAction subclass in the way you might expect. For example,
// a PDFActionURL may return "URI" or "Launch" depending upon the original action (as defined in the PDF spec. - for
// the PDFKit API we decided to handle the two actions within the same class and also use the more familiar 'URL' term
// rather than 'URI').
// Type based on the Adobe PDF Specification (1.7), Table 8.48: Action types.
@property (nonatomic, readonly) NSString *type;
@end
NS_ASSUME_NONNULL_END
// ========== PDFKit.framework/Headers/PDFActionRemoteGoTo.h
//
// PDFActionRemoteGoTo.h
// Copyright © 2019 Apple. All rights reserved.
//
// PDFActionRemoteGoTo is an interaction event tied with an annotation. This action
// is the same action type as PDFActionGoTo, but references another document, allowing
// you to jump to specific pages or positions in other PDF files.
//
#import <PDFKit/PDFKitPlatform.h>
#import <PDFKit/PDFAction.h>
NS_ASSUME_NONNULL_BEGIN
@class PDFActionRemoteGoToPrivateVars;
PDFKIT_CLASS_AVAILABLE(10_5, 11_0)
@interface PDFActionRemoteGoTo : PDFAction <NSCopying>
{
@private
PDFActionRemoteGoToPrivateVars *_private2;
}
// As with the calls below, note that PDFActionRemoteGoTo uses a zero-based page index and not a PDFPage object.
// This simplifies dealing with remote destinations for documents that may not be instantiated.
- (instancetype)initWithPageIndex:(NSUInteger)pageIndex atPoint:(PDFPoint)point fileURL:(NSURL *)url NS_DESIGNATED_INITIALIZER;
// Get and set the page index (zero-based) referenced by the action.
@property (nonatomic) NSUInteger pageIndex;
// Get and set the point on the above page referenced by the action. Just like PDFDestination a value of
// kPDFDestinationUnspecifiedValue for the x or the y of the point indicates that no position is specified.
@property (nonatomic) PDFPoint point;
// Get and set the URL of the document referenced from the action.
@property (nonatomic, copy) NSURL *URL;
@end
NS_ASSUME_NONNULL_END
// ========== PDFKit.framework/Headers/PDFActionGoTo.h
//
// PDFActionGoto.h
// Copyright © 2019 Apple. All rights reserved.
//
// PDFActionGoTo is an interaction event tied with an annotation. This action
// allows the user to jump to a PDFDestination, which is typically a position
// on a page paired with a zoom factor.
//
#import <PDFKit/PDFKitPlatform.h>
#import <PDFKit/PDFAction.h>
NS_ASSUME_NONNULL_BEGIN
@class PDFDestination, PDFActionGoToPrivateVars;
PDFKIT_CLASS_AVAILABLE(10_5, 11_0)
@interface PDFActionGoTo : PDFAction <NSCopying>
{
@private
PDFActionGoToPrivateVars *_private2;
}
- (instancetype)initWithDestination:(PDFDestination *)destination NS_DESIGNATED_INITIALIZER;
@property (nonatomic, strong) PDFDestination *destination;
@end
NS_ASSUME_NONNULL_END
// ========== PDFKit.framework/Headers/PDFAppearanceCharacteristics.h
//
// PDFAppearanceCharacteristics.h
// Copyright © 2019 Apple. All rights reserved.
//
// PDFAppearanceCharacteristics represents a dictionary that is specific to widget annotation types,
// containing additional information for constructing the annotationâs appearance.
// It is designed to be a representation of the /MK appearance characteristics entry in
// the annotation dictionary. Because the /MK entry is optional, all properties of
// PDFAppearanceCharacteristics are optional as well.
//
// Properties are based on the Adobe PDF Specification (1.7),
// Table 8.40: Entries in an appearance characteristics dictionary
//
#import <PDFKit/PDFKitPlatform.h>
#import <PDFKit/PDFAnnotationUtilities.h>
NS_ASSUME_NONNULL_BEGIN
// Widget appearance characteristics keys.
typedef NSString* const PDFAppearanceCharacteristicsKey NS_STRING_ENUM;
PDFKIT_EXTERN PDFAppearanceCharacteristicsKey PDFAppearanceCharacteristicsKeyBackgroundColor PDFKIT_AVAILABLE(10_13, 11_0);
PDFKIT_EXTERN PDFAppearanceCharacteristicsKey PDFAppearanceCharacteristicsKeyBorderColor PDFKIT_AVAILABLE(10_13, 11_0);
PDFKIT_EXTERN PDFAppearanceCharacteristicsKey PDFAppearanceCharacteristicsKeyRotation PDFKIT_AVAILABLE(10_13, 11_0);
PDFKIT_EXTERN PDFAppearanceCharacteristicsKey PDFAppearanceCharacteristicsKeyCaption PDFKIT_AVAILABLE(10_13, 11_0);
PDFKIT_EXTERN PDFAppearanceCharacteristicsKey PDFAppearanceCharacteristicsKeyRolloverCaption PDFKIT_AVAILABLE(10_13, 11_0);
PDFKIT_EXTERN PDFAppearanceCharacteristicsKey PDFAppearanceCharacteristicsKeyDownCaption PDFKIT_AVAILABLE(10_13, 11_0);
@class PDFAppearanceCharacteristicsPrivate;
PDFKIT_CLASS_AVAILABLE(10_13, 11_0)
@interface PDFAppearanceCharacteristics : NSObject <NSCopying>
{
@private
PDFAppearanceCharacteristicsPrivate *_private;
}
// -------- accessors
// For button widget annotations, need to specify the control type for PDFAppearanceCharacteristics
// as certain attributes, i.e. captions, are only available for certain flavors.
// Control type does not need to be set for text or choice widget annotations.
@property (nonatomic) PDFWidgetControlType controlType;
// The background color of the widget annotation.
@property (nonatomic, copy, nullable) PDFKitPlatformColor *backgroundColor;
// The border color of the widget annotation.
@property (nonatomic, copy, nullable) PDFKitPlatformColor *borderColor;
// The number of *degrees* by which the widget annotation is rotated counterclockwise relative to the page.
// The value must be a multiple of 90. Default value: 0.
@property (nonatomic) NSInteger rotation;
// The widget annotationâs normal caption, displayed when it is not interacting with the user.
@property (nonatomic, copy, nullable) NSString *caption;
// The widget's caption displayed when the user moves the mouse over the annotation.
// Applies only to kPDFWidgetPushButtonControl.
@property (nonatomic, copy, nullable) NSString *rolloverCaption;
// The widget's caption displayed when the user holds the mouse button while over the annotation.
// Applies only to kPDFWidgetPushButtonControl.
@property (nonatomic, copy, nullable) NSString *downCaption;
// List all appearance characteristics properties as key-value pairs; returns a deep copy of all pairs.
// Helpful for debugging.
@property (nonatomic, readonly, copy) NSDictionary *appearanceCharacteristicsKeyValues;
@end
NS_ASSUME_NONNULL_END
// ========== PDFKit.framework/Headers/PDFDestination.h
//
// PDFDestination.h
// Copyright © 2019 Apple. All rights reserved.
//
// PDFDestination represents a dictionary used in annotations, typically as
// a property for an action. Destinations are a coordinate and zoom factor
// for a specific page in a document.
//
#import <PDFKit/PDFKitPlatform.h>
NS_ASSUME_NONNULL_BEGIN
@class PDFPage, PDFDestinationPrivate;
// To specify a destination point where you don't care about the x or y value (or either), use this value.
PDFKIT_EXTERN const CGFloat kPDFDestinationUnspecifiedValue PDFKIT_AVAILABLE(10_4, 11_0);
PDFKIT_CLASS_AVAILABLE(10_4, 11_0)
@interface PDFDestination : NSObject <NSCopying>
{
@private
PDFDestinationPrivate *_private;
}
// -------- initializer
// Initializer. You do not often create PDFDestinations, but usually get them from link annotations or PDFOutline items.
- (instancetype)initWithPage:(PDFPage *)page atPoint:(PDFPoint)point NS_DESIGNATED_INITIALIZER;
// -------- accessors
// The page that the destination refers to (destination page).
@property (nonatomic, weak, readonly) PDFPage *page;
// The destination point on the page above (in page space).
@property (nonatomic, readonly) PDFPoint point;
// Get / set the scale factor the PDF viewer should assume for this destination.
// kPDFDestinationUnspecifiedValue indicates the scale factor is unaffected.
@property (nonatomic) CGFloat zoom PDFKIT_AVAILABLE(10_7, 11_0);
// If the destination passed in is further along in the document than the receiver, we return NSOrderedAscending. If
// the destination passed in precedes the receiver, we return NSOrderedDescending. Otherwise if the destination passed in
// matches the receiver, we return NSOrderedSame. For purposes of comparison, the horizontal component on the point is
// ignored. Also for purposes of comparison, having kPDFDestinationUnspecifiedValue for the vertical component of the
// destination point will be treated as the top point on the destination page.
// An exception will be raised if either destination does not have a page associated with it or if the pages of the two
// destinations are associated with different documents.
- (NSComparisonResult)compare:(PDFDestination *)destination PDFKIT_AVAILABLE(10_5, 11_0);
@end
NS_ASSUME_NONNULL_END
// ========== PDFKit.framework/Headers/PDFActionNamed.h
//
// PDFActionNamed.h
// Copyright © 2019 Apple. All rights reserved.
//
// PDFActionNamed is an interaction event tied with an annotation. This action
// allows the user to change their navigation stack or their current view. This
// can manipulate the user's navigation stack (move to the previous page, next page etc.),
// trigger some other forms of interactions (string search, printing, etc.), and
// manipulate the current view (change zoom factors).
//
#import <PDFKit/PDFKitPlatform.h>
#import <PDFKit/PDFAction.h>
NS_ASSUME_NONNULL_BEGIN
@class PDFActionNamedPrivateVars;
// Action names.
PDFKIT_ENUM_AVAILABLE(10_5, 11_0)
typedef NS_ENUM(NSInteger, PDFActionNamedName)
{
kPDFActionNamedNone = 0,
kPDFActionNamedNextPage = 1,
kPDFActionNamedPreviousPage = 2,
kPDFActionNamedFirstPage = 3,
kPDFActionNamedLastPage = 4,
kPDFActionNamedGoBack = 5,
kPDFActionNamedGoForward = 6,
kPDFActionNamedGoToPage = 7,
kPDFActionNamedFind = 8,
kPDFActionNamedPrint = 9,
kPDFActionNamedZoomIn = 10,
kPDFActionNamedZoomOut = 11
};
PDFKIT_CLASS_AVAILABLE(10_5, 11_0)
@interface PDFActionNamed : PDFAction <NSCopying>
{
@private
PDFActionNamedPrivateVars *_private2;
}
- (instancetype)initWithName:(PDFActionNamedName)name NS_DESIGNATED_INITIALIZER;
@property (nonatomic) PDFActionNamedName name;
@end
NS_ASSUME_NONNULL_END
// ========== PDFKit.framework/Headers/PDFActionURL.h
//
// PDFActionURL.h
// Copyright © 2019 Apple. All rights reserved.
//
// PDFActionURL is an interaction event tied with an annotation. This action allows
// the user to open a URL, either being a local file or web URL.
//
#import <PDFKit/PDFAction.h>
NS_ASSUME_NONNULL_BEGIN
@class PDFActionURLPrivateVars;
PDFKIT_CLASS_AVAILABLE(10_5, 11_0)
@interface PDFActionURL : PDFAction <NSCopying>
{
@private
PDFActionURLPrivateVars *_private2;
}
- (instancetype)initWithURL:(NSURL *)url NS_DESIGNATED_INITIALIZER;
@property (nonatomic, copy, nullable) NSURL *URL;
@end
NS_ASSUME_NONNULL_END
// ========== PDFKit.framework/Headers/PDFThumbnailView.h
//
// PDFThumbnailView.h
// Copyright © 2019 Apple. All rights reserved.
//
// PDFThumbnailView is a custom view that contains a set of PDFPage thumbnails
// that a user can scroll over, interact with, and have these interactions drive
// view changes on PDFView.
//
#import <PDFKit/PDFKitPlatform.h>
NS_ASSUME_NONNULL_BEGIN
// Layout mode for thumbnail view.
PDFKIT_ENUM_AVAILABLE(NA, 11_0)
typedef NS_ENUM(NSInteger, PDFThumbnailLayoutMode)
{
PDFThumbnailLayoutModeVertical = 0,
PDFThumbnailLayoutModeHorizontal = 1
};
@class PDFView, PDFPage, PDFThumbnailViewPrivate;
// Notification when PDFDocument is modified.
PDFKIT_EXTERN NSString* const PDFThumbnailViewDocumentEditedNotification PDFKIT_AVAILABLE(10_4, 11_0);
PDFKIT_CLASS_AVAILABLE(10_5, 11_0)
@interface PDFThumbnailView : PDFKitPlatformView <NSCoding>
{
@private
PDFThumbnailViewPrivate *_private;
}
// PDFView associated with the thumbnail view.
@property (nonatomic, weak, nullable) PDFView *PDFView;
// Background color of view.
@property (nonatomic, copy, nullable) PDFKitPlatformColor *backgroundColor;
// This will return only a single page unless allowsMultipleSelection is set to YES.
@property (nonatomic, readonly, strong, nullable) NSArray<PDFPage*> *selectedPages;
// The maximum thumbnail size.
@property (nonatomic) PDFSize thumbnailSize;
// Defines if the thumbnail view is to be displayed vertically or horizontally.
// Default PDFThumbnailLayoutModeVertical.
@property (nonatomic) PDFThumbnailLayoutMode layoutMode PDFKIT_AVAILABLE(NA, 11_0);
// Inset for the placement of icons within the thumbnail view. Default UIEdgeInsetsZero.
@property (nonatomic) UIEdgeInsets contentInset PDFKIT_AVAILABLE(NA, 11_0);
@end
NS_ASSUME_NONNULL_END
// ========== PDFKit.framework/Headers/PDFBorder.h
//
// PDFBorder.h
// Copyright © 2019 Apple. All rights reserved.
//
// PDFBorder represents an array structure that is common for graphical annotations,
// defining properties like line-stroke width, color, and dashed patterns.
// It is designed to be a representation of the /BS entry in the annotation dictionary.
//
// Properties are based on the Adobe PDF Specification (1.7)
// Table 8.17: Entries in a border style dictionary.
//
#import <PDFKit/PDFKitPlatform.h>
NS_ASSUME_NONNULL_BEGIN
@class PDFBorderPrivateVars;
// Style in which PDFBorder is displayed.
PDFKIT_ENUM_AVAILABLE(10_4, 11_0)
typedef NS_ENUM(NSInteger, PDFBorderStyle)
{
kPDFBorderStyleSolid = 0,
kPDFBorderStyleDashed = 1,
kPDFBorderStyleBeveled = 2,
kPDFBorderStyleInset = 3,
kPDFBorderStyleUnderline = 4
};
// Border style dictionary keys.
typedef NSString* const PDFBorderKey NS_STRING_ENUM;
PDFKIT_EXTERN PDFBorderKey PDFBorderKeyLineWidth PDFKIT_AVAILABLE(10_13, 11_0);
PDFKIT_EXTERN PDFBorderKey PDFBorderKeyStyle PDFKIT_AVAILABLE(10_13, 11_0);
PDFKIT_EXTERN PDFBorderKey PDFBorderKeyDashPattern PDFKIT_AVAILABLE(10_13, 11_0);
// PDFBorder is not directly an annotation, but instead is a supportive structure common to a few annotations.
PDFKIT_CLASS_AVAILABLE(10_4, 11_0)
@interface PDFBorder : NSObject <NSCopying, NSCoding>
{
@private
PDFBorderPrivateVars *_private;
}
// -------- accessors
// See styles above. Whether border is drawn solid, dashed etc.
@property (nonatomic) PDFBorderStyle style;
// Width of line used to stroke border.
@property (nonatomic) CGFloat lineWidth;
// Array of floats specifying the dash pattern (see NSBezierPath for more detail).
@property (nonatomic, copy, nullable) NSArray *dashPattern;
// List all border properties as key-value pairs; returns a deep copy of all pairs. Helpful for debugging.
@property (nonatomic, readonly, copy) NSDictionary *borderKeyValues;
// Draw method. Not generally needed since the annotations themselves call this method when they are drawn.
// Call -[NSColor set] before calling (the various annotations do this often calling -[PDFAnnotation color] or whatever
// is appropriate for their class.
- (void)drawInRect:(PDFRect)rect;
@end
NS_ASSUME_NONNULL_END
// ========== PDFKit.framework/Headers/PDFView.h
//
// PDFView.h
// Copyright © 2019 Apple. All rights reserved.
//
// This class is the main view of PDFKit: you can instantiate a PDFView or create one
// in Interface Builder that will host the contents of a PDFDocument. Note that you can
// layout the pages of a PDFDocument in a few different ways, mostly as a function of
// PDFDisplayMode, combined with a few options like "displayDirection" and "displaysRTL".
// Note the delegate PDFViewDelegate and associated notifications, both of which can be
// used as a way to listen for search, print, and user-interaction events.
//
#import <PDFKit/PDFKitPlatform.h>
#import <PDFKit/PDFDocument.h>
#import <PDFKit/PDFPage.h>
NS_ASSUME_NONNULL_BEGIN
@class PDFAction, PDFActionRemoteGoTo, PDFDestination, PDFSelection, PDFViewPrivate;
@protocol PDFViewDelegate;
// Display modes.
PDFKIT_ENUM_AVAILABLE(10_4, 11_0)
typedef NS_ENUM(NSInteger, PDFDisplayMode)
{
kPDFDisplaySinglePage = 0,
kPDFDisplaySinglePageContinuous = 1,
kPDFDisplayTwoUp = 2,
kPDFDisplayTwoUpContinuous = 3
};
// Display direction.
PDFKIT_ENUM_AVAILABLE(10_13, 11_0)
typedef NS_ENUM(NSInteger, PDFDisplayDirection)
{
kPDFDisplayDirectionVertical = 0,
kPDFDisplayDirectionHorizontal = 1,
};
// PDF areas of interest (bitfield, multiple bits below may be set).
PDFKIT_AVAILABLE(10_4, 11_0)
typedef NS_OPTIONS(NSInteger, PDFAreaOfInterest)
{
kPDFNoArea = 0,
kPDFPageArea = (1UL << 0),
kPDFTextArea = (1UL << 1),
kPDFAnnotationArea = (1UL << 2),
kPDFLinkArea = (1UL << 3),
kPDFControlArea = (1UL << 4),
kPDFTextFieldArea = (1UL << 5),
kPDFIconArea = (1UL << 6),
kPDFPopupArea = (1UL << 7),
kPDFImageArea = (1UL << 8),
};
// Interpolation quality.
PDFKIT_ENUM_AVAILABLE(10_7, 11_0)
typedef NS_ENUM(NSInteger, PDFInterpolationQuality)
{
kPDFInterpolationQualityNone = 0,
kPDFInterpolationQualityLow = 1,
kPDFInterpolationQualityHigh = 2
};
// Notifications.
PDFKIT_EXTERN NSNotificationName const PDFViewDocumentChangedNotification PDFKIT_AVAILABLE(10_4, 11_0); // Notification when a new document is associated with view.
PDFKIT_EXTERN NSNotificationName const PDFViewChangedHistoryNotification PDFKIT_AVAILABLE(10_4, 11_0); // Notification when the page history changes.
PDFKIT_EXTERN NSNotificationName const PDFViewPageChangedNotification PDFKIT_AVAILABLE(10_4, 11_0); // Notification when a new page becomes current.
PDFKIT_EXTERN NSNotificationName const PDFViewScaleChangedNotification PDFKIT_AVAILABLE(10_4, 11_0); // Notification when the scale changes.
PDFKIT_EXTERN NSNotificationName const PDFViewAnnotationHitNotification PDFKIT_AVAILABLE(10_4, 11_0); // Notification when the user clicks on an annotation.
PDFKIT_EXTERN NSNotificationName const PDFViewCopyPermissionNotification PDFKIT_AVAILABLE(10_4, 11_0); // Notification when the user is denied copy (permissions).
PDFKIT_EXTERN NSNotificationName const PDFViewPrintPermissionNotification PDFKIT_AVAILABLE(10_4, 11_0); // Notification when the user is denied print (permissions).
PDFKIT_EXTERN NSNotificationName const PDFViewAnnotationWillHitNotification PDFKIT_AVAILABLE(10_4, 11_0); // Notification before user clicks on an annotation.
PDFKIT_EXTERN NSNotificationName const PDFViewSelectionChangedNotification PDFKIT_AVAILABLE(10_4, 11_0); // Notification when the current selection has changed.
PDFKIT_EXTERN NSNotificationName const PDFViewDisplayModeChangedNotification PDFKIT_AVAILABLE(10_4, 11_0); // Notification when the display mode has changed.
PDFKIT_EXTERN NSNotificationName const PDFViewDisplayBoxChangedNotification PDFKIT_AVAILABLE(10_4, 11_0); // Notification when the display box has changed.
PDFKIT_EXTERN NSNotificationName const PDFViewVisiblePagesChangedNotification PDFKIT_AVAILABLE(10_4, 11_0); // Notification when the scroll view has scrolled into the bounds of a new page.
PDFKIT_CLASS_AVAILABLE(10_4, 11_0)
@interface PDFView : PDFKitPlatformView
< UIGestureRecognizerDelegate >
{
@private
PDFViewPrivate *_private;
}
// -------- document
// Methods for associating a PDFDocument with a PDFView.
@property (nonatomic, retain, nullable) PDFDocument *document;
// -------- page navigation
// Simple page navigation methods.
@property (nonatomic, readonly) BOOL canGoToFirstPage;
- (IBAction)goToFirstPage:(nullable id)sender;
@property (nonatomic, readonly) BOOL canGoToLastPage;
- (IBAction)goToLastPage:(nullable id)sender;
@property (nonatomic, readonly) BOOL canGoToNextPage;
- (IBAction)goToNextPage:(nullable id)sender;
@property (nonatomic, readonly) BOOL canGoToPreviousPage;
- (IBAction)goToPreviousPage:(nullable id)sender;
// Page visitations done via goToFirstPage:, goToLastPage:, goToPage:, etc. methods are recorded with visitation history
// and can be revisited by executing goBack: or goForward:, much like a web browser. Note that visitiation history
// also includes all rect, destination, and selection goTo*: methods.
@property (nonatomic, readonly) BOOL canGoBack;
- (IBAction)goBack:(nullable id)sender;
@property (nonatomic, readonly) BOOL canGoForward;
- (IBAction)goForward:(nullable id)sender;
// Returns the current page you are on. For two-up modes, it is the left page (if there are two). For continuous modes,
// it finds the page crossing a horizontal line halfway between the views top and bottom bounds.
@property (nonatomic, readonly, nullable) PDFPage *currentPage;
// Scrolls to page.
- (void)goToPage:(PDFPage *)page;
// Returns a PDFDestination representing the current page and point displayed (see -[currentPage] for more comments).
@property (nonatomic, readonly, nullable) PDFDestination *currentDestination;
// Goes to the specified destination.
- (void)goToDestination:(PDFDestination *)destination;
// Goes to the specified selection (since selections can be large, goes to the first character of the selection).
- (void)goToSelection:(PDFSelection *)selection;
// Goes to the specified rectangle on the specified page. If already visible, does nothing. This allows you to scroll
// the PDFView to a specific PDFAnnotation or PDFSelection (since both object have bounds methods).
// Note: rect is specified in page coordinates. Example: You might use this function when tabbing through a form to keep
// focus on the active element.
- (void)goToRect:(PDFRect)rect onPage:(PDFPage *)page;
// -------- display mode
// See PDFDisplayMode constants above. Default is kPDFDisplaySinglePageContinuous.
@property (nonatomic) PDFDisplayMode displayMode;
// Set the layout direction, either vertical or horizontal, for the given display mode
// Defaults to vertical layout (kPDFDisplayDirectionVertical).
@property (nonatomic) PDFDisplayDirection displayDirection PDFKIT_AVAILABLE(10_13, 11_0);
// Toggle displaying or not displaying page breaks (spacing) between pages. This spacing value
// is defined by the pageBreakMargins property. If displaysPageBreaks is NO, then pageBreakMargins
// will always return { 0.0, 0.0, 0.0, 0.0 }. Default is YES.
@property (nonatomic) BOOL displaysPageBreaks;
// If displaysPageBreaks is enabled, you may customize the spacing between pages by defining margins for
// the top, bottom, left, and right of each page. Note that pageBreakMargins only allows positive values
// and will clamp any negative value to 0.0. By default, if displaysPageBreaks is enabled, pageBreakMargins
// is { 4.75, 4.0, 4.75, 4.0 } (with respect to top, left, bottom, right), otherwise it is { 0.0, 0.0, 0.0, 0.0 }
@property (nonatomic) PDFEdgeInsets pageBreakMargins PDFKIT_AVAILABLE(10_13, 11_0);
// Specifies the box to display/clip to. Default is kPDFDisplayBoxCropBox.
@property (nonatomic) PDFDisplayBox displayBox;
// Specifies whether the first page is to be treated as a cover and (for two-up modes) displayed by itself.
@property (nonatomic) BOOL displaysAsBook;
// Specifies presentation of pages from right-to-left. Defaults to NO.
@property (nonatomic) BOOL displaysRTL PDFKIT_AVAILABLE(10_13, 11_0);
// Default is a 50% gray.
@property (nonatomic, strong) PDFKitPlatformColor *backgroundColor;
// Allows setting the interpolation quality for images drawn into the PDFView context.
@property (nonatomic) PDFInterpolationQuality interpolationQuality PDFKIT_AVAILABLE(10_7, 11_0);
// Specifies if shadows should be drawn around page borders in a PDFView. Defaults to YES.
@property (nonatomic, setter=enablePageShadows:) BOOL pageShadowsEnabled PDFKIT_AVAILABLE(10_14, 12_0);
// Changes the underlying scroll view to use a UIPageViewController as a way to layout and navigate
// pages. Note that you can change the orientation via -[PDFView setDisplayDirection:], and that
// the property -[PDFView displayMode] is ignored: layout is always assumed single page continuous.
// The viewOptions argument is given to the UIPageViewController initializer, as a way to pass in page spacing, etc.
- (void)usePageViewController:(BOOL)enable withViewOptions:(nullable NSDictionary*)viewOptions PDFKIT_AVAILABLE(NA, 11_0);
@property (nonatomic, readonly) BOOL isUsingPageViewController PDFKIT_AVAILABLE(NA, 11_0);
// -------- delegate
@property (nonatomic, weak, nullable) id< PDFViewDelegate > delegate;
// -------- scaling
// Method to get / set the current scaling on the displayed PDF document. Default is 1.0 (actual size).
// Note that the given scaleFactor is clamped by the current min / max scale factors.
// When using a page view controller layout on iOS, this only affects the currently visible page and
// is ignored for any future loaded pages. You can observe the PDFViewPageChangedNotification notification
// to see when new pages are visible to apply new scale factors to them.
@property (nonatomic) CGFloat scaleFactor;
// Set the minimum and maximum scaling factors for the PDF document. Assigning these values will implicitly turn
// off autoScales, and allows scaleFactor to vary between these min / max scale factors
@property (nonatomic) CGFloat minScaleFactor PDFKIT_AVAILABLE(10_13, 11_0);
@property (nonatomic) CGFloat maxScaleFactor PDFKIT_AVAILABLE(10_13, 11_0);
// Toggles mode whereby the scale factor is automatically changed as the view is resized, or rotated, to maximize the
// PDF displayed. For continuous modes this is a "fit width" behavior, for non-continuous modes it is a "best fit" behavior.
@property (nonatomic) BOOL autoScales;
// Regardless of current autoScales mode, this returns the "size to fit" scale factor that autoScales would use
// for scaling the current document and layout. For continuous modes this is a "fit width" scale, for
// non-continuous modes it is a "best fit" scale.
@property (nonatomic, readonly) CGFloat scaleFactorForSizeToFit PDFKIT_AVAILABLE(10_13, 11_0);
// Zooming changes the scaling by root-2.
- (IBAction)zoomIn:(nullable id)sender;
@property (nonatomic, readonly) BOOL canZoomIn;
- (IBAction)zoomOut:(nullable id)sender;
@property (nonatomic, readonly) BOOL canZoomOut;
// -------- events
// Returns type of area (see defines above) mouse is over. This method is useful for subclasses.
- (PDFAreaOfInterest)areaOfInterestForMouse:(PDFKitPlatformEvent *)event;
- (PDFAreaOfInterest)areaOfInterestForPoint:(PDFPoint)cursorLocation;
// Performs the action specified by action.
- (void)performAction:(PDFAction *)action PDFKIT_AVAILABLE(10_5, 11_0);
// -------- selection
// Getter: Returns actual instance of the current PDFSelection object. If you wish to modify this, you should make a copy of
// the selection returned and modify that instead. Method may return nil if there is no selection.
// Setter: Set current selection to selection. The view will redraw as necessary. The view will not scroll.
// Call -[scrollSelectionToVisible:] to scroll to the current selection.
@property (nonatomic, strong, nullable) PDFSelection *currentSelection;
// Like -[setCurrentSelection:] above but with the additional parameter that specifies whether setting the selection
// should be animated. The animation draws the user's attention to the new selection. Useful when searching.
- (void)setCurrentSelection:(nullable PDFSelection *)selection animate:(BOOL)animate PDFKIT_AVAILABLE(10_5, 11_0);
// Equivalent to -[PDFView setCurrentSelection: nil].
- (void)clearSelection;
// Select all text for the entire document, unless in in page view controller mode for iOS,
// where only the current page is selected.
- (IBAction)selectAll:(nullable id)sender;
// If the selection is not visible, scrolls view so that it is.
- (IBAction)scrollSelectionToVisible:(nullable id)sender;
// The following calls allow you to associate an array of PDFSelections with a PDFView. Unlike the user selection
// (above), these selections do not go away when the user clicks in the PDFView, etc. You must explicitly remove them
// by passing nil to -[setHighlightedSelections:]. These methods allow you to highlight text perhaps to indicate
// matches from a text search. To avoid confusion you should probably make sure the PDFSelections passed in are a
// different color from the user's default text selection color. Commonly used for highlighting search results.
@property (nonatomic, copy, nullable) NSArray<PDFSelection*> *highlightedSelections PDFKIT_AVAILABLE(10_5, 11_0);
// -------- rendering
// Context-aware subclassing functions
// For subclasses. This method is called for each visible page requiring rendering. By subclassing you can draw on top
// of the PDF page or draw the page entirely yourself. Default implementation erases page to white and calls:
// [page drawWithBox: [self displayBox] toContext: context]. Note that this may be called multiple times for
// the same page due to tiling of renderable content.
- (void)drawPage:(PDFPage *)page toContext:(CGContextRef)context PDFKIT_AVAILABLE(10_12, 11_0);
// Also a handy method for sub-classing. Called for post-page rendering. In this method however no scaling/rotating is
// applied to the current context to map to page-space. The context is in "view-space" coordinates.
- (void)drawPagePost:(PDFPage *)page toContext:(CGContextRef)context PDFKIT_AVAILABLE(10_12, 11_0);
// -------- pasteboard
// Copy the selection (if any) to the pasteboard.
- (IBAction)copy:(nullable id)sender;
// -------- conversion
// Given a point in view coordinates, returns the page at that point. May return nil if no page at point and nearest is NO.