Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

PSPDFKit 2.2.0 - PSPDFPageScrollContinuousTransition, smarter annotat…

…ion selection, pdf link annotations to other documents and countless other improvements & bug fixes.

Former-commit-id: 5f91c3d
  • Loading branch information...
commit 280b726e5423559d53a063fdd1e456335d9fe416 1 parent be1212d
@steipete steipete authored
Showing with 1,762 additions and 1,028 deletions.
  1. +1 −1  .gitignore
  2. +76 −0 CHANGELOG.md
  3. +1 −2  Examples/PSPDFCatalog/Kiosk/PSCSettingsController.m
  4. +0 −186 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSCollectionView.h
  5. +0 −50 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSCollectionViewCommon.h
  6. +0 −21 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSCollectionViewController.h
  7. +0 −122 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSCollectionViewFlowLayout.h
  8. +37 −31 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFAnnotation.h
  9. +5 −5 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFAnnotationParser.h
  10. +3 −3 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFAnnotationToolbar.h
  11. +1 −1  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFAnnotationView.h
  12. +1 −1  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFBarButtonItem.h
  13. +1 −1  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFBookmark.h
  14. +7 −4 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFBookmarkParser.h
  15. +39 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFBrightnessViewController.h
  16. +17 −17 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFCache.h
  17. +2 −2 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFColorButton.h
  18. +38 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFColorSelectionViewController.h
  19. +26 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFColorView.h
  20. +4 −4 ...dedframework/PSPDFKit.framework/Versions/A/Headers/{PSPDFPagedScrollView.h → PSPDFContentScrollView.h}
  21. +32 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFContinuousScrollViewController.h
  22. +104 −78 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFDocument.h
  23. +8 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFDocumentDelegate.h
  24. +3 −3 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFDocumentLabelView.h
  25. +4 −4 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFDocumentParser.h
  26. +34 −29 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFDocumentProvider.h
  27. +3 −3 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFDrawView.h
  28. +2 −2 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFFreeTextAnnotation.h
  29. +10 −10 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFGlyph.h
  30. +28 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFGradientView.h
  31. +1 −1  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFGraphicsState.h
  32. +1 −0  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFHighlightAnnotation.h
  33. +1 −1  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFHighlightAnnotationView.h
  34. +2 −1  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFIconGenerator.h
  35. +2 −2 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFImageAnnotationView.h
  36. +5 −4 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFKit.h
  37. +19 −6 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFKitGlobal.h
  38. +7 −4 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFLabelParser.h
  39. +18 −16 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFLinkAnnotation.h
  40. +1 −1  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFLinkAnnotationBaseView.h
  41. +7 −7 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFLinkAnnotationView.h
  42. +0 −1  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFLongPressGestureRecognizer.h
  43. +6 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFLoupeView.h
  44. +3 −3 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFMenuItem.h
  45. +1 −0  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFNoteAnnotation.h
  46. +10 −6 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFNoteAnnotationController.h
  47. +39 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFOrderedDictionary.h
  48. +3 −3 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFOutlineCell.h
  49. +5 −5 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFOutlineElement.h
  50. +7 −4 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFOutlineParser.h
  51. +4 −4 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFOutlineViewController.h
  52. +6 −6 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFPageInfo.h
  53. +10 −9 .../PSPDFKit.framework/Versions/A/Headers/{PSPDFPagingViewController.h → PSPDFPageScrollViewController.h}
  54. +37 −25 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFPageView.h
  55. +2 −2 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFPageViewController.h
  56. +3 −3 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFPasswordView.h
  57. +1 −7 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFPatches.h
  58. +38 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFPopoverBackgroundView.h
  59. +3 −3 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFPositionView.h
  60. +9 −9 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFRenderQueue.h
  61. +3 −3 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFScrobbleBar.h
  62. +31 −26 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFScrollView.h
  63. +1 −1  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFSearchHighlightView.h
  64. +14 −12 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFSearchOperation.h
  65. +6 −6 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFSearchResult.h
  66. +1 −1  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFSearchStatusCell.h
  67. +8 −5 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFSearchViewController.h
  68. +1 −1  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFSelectionView.h
  69. +1 −1  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFShapeAnnotation.h
  70. +15 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFSimplePageViewController.h
  71. +5 −5 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFSinglePageViewController.h
  72. +32 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFStyleable.h
  73. +5 −5 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFTabBarButton.h
  74. +15 −7 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFTabBarView.h
  75. +12 −9 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFTabbedViewController.h
  76. +3 −1 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFTextBlock.h
  77. +2 −2 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFTextLine.h
  78. +9 −11 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFTextParser.h
  79. +4 −4 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFTextSearch.h
  80. +6 −10 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFTextSelectionView.h
  81. +9 −9 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFThumbnailGridViewCell.h
  82. +3 −3 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFTransitionHelper.h
  83. +7 −4 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFTransitionProtocol.h
  84. +7 −7 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFVideoAnnotationView.h
  85. +91 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFViewController+Delegates.h
  86. +112 −86 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFViewController.h
  87. +2 −0  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFViewControllerDelegate.h
  88. +4 −4 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFViewState.h
  89. +2 −2 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFWebAnnotationView.h
  90. +19 −11 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFWebViewController.h
  91. +6 −4 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFWord.h
  92. +4 −4 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFYouTubeAnnotationView.h
  93. +164 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSTCollectionView.h
  94. +11 −23 ...ddedframework/PSPDFKit.framework/Versions/A/Headers/{PSCollectionViewCell.h → PSTCollectionViewCell.h}
  95. +94 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSTCollectionViewCommon.h
  96. +20 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSTCollectionViewController.h
  97. +125 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSTCollectionViewFlowLayout.h
  98. +40 −39 ...framework/PSPDFKit.framework/Versions/A/Headers/{PSCollectionViewLayout.h → PSTCollectionViewLayout.h}
  99. +2 −2 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Resources/Info.plist
  100. BIN  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Resources/PSPDFKit.bundle/Play@2x.png
  101. +13 −2 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Resources/PSPDFKit.bundle/de.lproj/PSPDFKit.strings
  102. +14 −2 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Resources/PSPDFKit.bundle/en.lproj/PSPDFKit.strings
  103. +13 −2 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Resources/PSPDFKit.bundle/fr.lproj/PSPDFKit.strings
  104. BIN  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Resources/PSPDFKit.bundle/freetext.png
  105. BIN  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Resources/PSPDFKit.bundle/freetext@2x.png
  106. BIN  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Resources/PSPDFKit.bundle/highlight.png
  107. BIN  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Resources/PSPDFKit.bundle/highlight@2x.png
  108. +87 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Resources/PSPDFKit.bundle/it.lproj/PSPDFKit.strings
  109. BIN  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Resources/PSPDFKit.bundle/newcomment@2x.png
  110. BIN  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Resources/PSPDFKit.bundle/strikeout.png
  111. BIN  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Resources/PSPDFKit.bundle/strikeout@2x.png
  112. BIN  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Resources/PSPDFKit.bundle/underline.png
  113. +1 −1  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Resources/VERSION
View
2  .gitignore
@@ -27,4 +27,4 @@ Development
Releases
Products
Samples
-InfoPlist.h
+InfoPlist.h
View
76 CHANGELOG.md
@@ -1,5 +1,81 @@
# Changelog
+__v2.2.0 - 4/October/2012__
+
+Note: This will be the last release that supports iOS 4.3*. The next version will be iOS 5+ only and will require Xcode 4.5+ (iOS SDK 6.0)
+ If you're having any comments on this, I would love to hear from you: pspdfkit@petersteinberger.com
+
+(*) There is no device that supports iOS 4.3 and can't be upgraded to iOS5, and PSPDFKit alrady dropped iOS4.2 and with it armv6 in 2.0.
+
+* New scrolling mode: PSPDFPageScrollContinuousTransition (similar to UIWebView's default mode)
+* Support text selection on rotated PDF documents.
+* UIPopoverController is now styleable with a tintColor. This is enabled by default if tintColor is set. Use .shouldTintPopovers to disable this.
+ As long as you use presentViewControllerModalOrPopover:embeddedInNavigationController:withCloseButton:animated:sender:options: your custom popovers will be styled the same way.
+* Adds support for adding annotations for double page mode on the right page. (Note: drawing still isn't perfect)
+* Add new property renderAnnotationTypes to PSPDFViewController to allow control about the types of annotations that should be rendered.
+* Add support for PDF Link Launch annotations (link to a different PDF within a PDF, see http://pspdfkit.com/documentation.html#annotations)
+* Annotation selection is now smarter and selects the annotation that's most likely chosen (e.g. a small note annotation now is clickable even if it's behind a big ink drawing annotation)
+* It's not possible to properly select an annotation while in highlight mode.
+* Allow changing the drawing color using the menu. (invokes the color picker)
+* Add a isEditable property to be able to lock certain annotations against future edits.
+* Add printing support for small CGDataProviderRef-based PSPDFDocuments.
+* Improve OpenIn… feature, annotations are auto-saved before opening in another app and a log warning will be displated for incompatible document compositions.
+* The password in PSPDFDocument is now saved and will be relayed to any added file (e.g. when using appendFile)
+* Improved performance for outline and annotation parsing (up to 400% faster, especially for large complex documents with huge outlines)
+* Massively improved performance for search, especially for documents with many fonts.
+* Text loupe is faster; less delays on the main thread when waiting for a textParser (more fine-grained locking)
+* PSPDFViewController now saves any unsaved annotation data when app moves to background.
+* Add PSPDFBrightnessBarButtonItem and optional software-dimming to darken the screen all the way down to black.
+* PSPDFDocuments objectsAtPDFRect:page:options: now can also search for annotations and text blocks.
+* Smart Zoom is now even smarter and picks the most likely tapped text block if the detection shows multiple overlaying blocks.
+* Adds italian translation.
+* Restores PDF page label feature from v1.
+* removeCacheForDocument:deleteDocument:error: now also removes any document metadata files (bookmarks, annotations [if they were saved externally])
+* The cancel button in PSPDFSearchViewController can now be localized.
+* PSPDFKit now uses UICollectionView on iOS6, and PSTCollectionView on iOS4/5.
+* When annotations are deserialized from disk, the proper annotation subclasses set in document.overrideClassNames will be used.
+* Ensure annotation toolbar is closed when view controller pops.
+* Thumbnails no longer are layed out behind the tab bar if PSPDFTabbedViewController is used. (they now correctly align beneath the bar)
+* Add workaround for a UIKit problem where a UIPopoverController could be resized to zero on iPad/landscape when it's just above the keyboard.
+* Greatly reduced the black hair line that was visible in double page modes between the pages. Should now be invisible in most cases.
+* The last used drawing color is now saved in the user defaults.
+* The bookmark image is now saved proportionaly to the thumbnail image.
+* Ensures that for PSPDFTabbedViewController, tabs always have a title.
+* The close button added when using the presentModal: api of PSPDFViewController now uses the Done-button style.
+* API: bookmark save/load now exposes NSError object. Also new; clearAllBookmarks.
+* API: willStartSearchOperation:forString:isFullSearch: in PSPDFSearchOperationDelegate is now optional.
+* API: PSPDFDocument now implements PSPDFDocumentProviderDelegate and also is set as the default delegate.
+* API: PSPDFDocumentDelegate now has methods for didSaveAnnotations and failedToSaveAnnotations.
+* API: removeCacheForDocument:deleteDocument:waitUntilDone: is now removeCacheForDocument:deleteDocument:error: - use dispatch_async to make the call async.
+* API: tabbedPDFController:willChangeVisibleDocument: has been renamed to tabbedPDFController:shouldChangeVisibleDocument:
+* Fixes a bug where annotations were not saved correctly on multi-file documents when saving into external file was used. You need to delete the annotations.pspdfkit file in /Library/PrivateDocuments/UID to update to the new saving version (PSPDFKit still first tries to read that file to be backwards compatible)
+* Fixes freezing if there are A LOT of search results. They are not limited to 600 by default. This can be changed in PSPDFSearchViewController, see maximumNumberOfSearchResultsDisplayed.
+* Fixes a issue where similar PDF documents could create a equal UID when initialized via NSData.
+* Fixes "jumping" of the annotation toolbar when the default toolbar style was used.
+* Fixes calling the shouldChangeDocuments delegate in PSPDFTabbedViewController.
+* Fixes issue with rotation handling under iOS6.
+* Fixes a bug that prevented selecting annotations for documents with multiple files on all but the first file
+* Fixes a bug where the text editor sometimes could have a transparent background.
+* Fixes a toolbar bug when using UIStoryboard and modal transitions to PSPDFViewController.
+* Fixes a rare placement bug with the document title label overlay on iPhone.
+* Fixes a regression of 2.1 where search on iPhone sometimes didn't jump to the correct page.
+* Fixes issue with certain unselectable words.
+* Fixes always-spinning activity indicator when internal WebBrowser was closed while page was still loading. ActivityIndicator management now also can be customized and/or disabled.
+* Fixes a page displacement issue with pageCurl and the app starting up in landscape, directly showing a PSPDFViewController. (workaround for a UIKit issue; has been fixed in iOS6)
+* Fixes invalid page coordinates sent to didTapOnPageView:atPoint: delegate on right page in landscape mode.
+* Fixes a race condition where annotations could be missing on display after repeated saving until the document has been reloaded.
+* Fixes issue with word detection where sometimes words were split apart after the first letter on the beginning of a line.
+* Fixes viewState generation. (Was always using page instead of realPage which lead to errors when using landscape mode)
+* Fixes missing background drawing for shape annotations.
+* Fixes a issue where certain link-annotations did not work when using the long-press and then tap on the sheet-button way.
+* Fixes a rare bug where pages could been missing when reloading the view of the PSPDFPerPageScrollTransition in a certain way.
+* Fixes issue where viewLockEnabled was ignored after calling reloadData.
+
+Known Issues:
+* Dragging note anotations from one page to another doesn't yet work.
+* Drawing across multiple pages doesn't yet work.
+
+
__v2.1.0 - 17/September/2012__
* New: PSPDFAESCryptoDataProvider. Allows fast, secure on-the-fly decryption of AES256-secured PDF documents. (PSPDFKit Annotate feature)
View
3  Examples/PSPDFCatalog/Kiosk/PSCSettingsController.m
@@ -64,8 +64,7 @@ + (NSDictionary *)settings { return _settings; }
_settings[StringSEL(pageMode)] = @(PSIsIpad() ? PSPDFPageModeAutomatic : PSPDFPageModeSingle);
_settings[StringSEL(isFitToWidthEnabled)] = @(!PSIsIpad());
_settings[StringSEL(linkAction)] = @(PSPDFLinkActionInlineBrowser);
- _settings[StringSEL(pageTransition)] = @(PSPDFPageScrollContinuousTransition);
- PSPDF_IF_PRE_IOS5(_settings[StringSEL(pageTransition)] = @(PSPDFPageScrollPerPageTransition);)
+ _settings[StringSEL(pageTransition)] = @(PSPDFPageScrollPerPageTransition);
_settings[StringSEL(pageScrolling)] = @(PSPDFScrollDirectionHorizontal);
_settings[StringSEL(isScrobbleBarEnabled)] = @(YES);
_settings[StringSEL(isZoomingSmallDocumentsEnabled)] = @(YES);
View
186 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSCollectionView.h
@@ -1,186 +0,0 @@
-//
-// PSCollectionView.h
-// PSPDFKit
-//
-// Copyright (c) 2012 Peter Steinberger. All rights reserved.
-//
-
-#import "PSCollectionViewLayout.h"
-#import "PSCollectionViewFlowLayout.h"
-#import "PSCollectionViewCell.h"
-
-@class PSCollectionViewController;
-
-// Define this to automatically return UICollection* variants on init if they are available.
-//#define kPSCollectionViewRelayToUICollectionViewIfAvailable
-
-// Allows code to just use UICollectionView as if it would be avaiable on iOS SDK 5.
-// http://developer.apple.com/legacy/mac/library/#documentation/DeveloperTools/gcc-3.3/gcc/compatibility_005falias.html
-#if __IPHONE_OS_VERSION_MAX_ALLOWED < 60000
-@compatibility_alias UICollectionViewController PSCollectionViewController;
-@compatibility_alias UICollectionView PSCollectionView;
-@compatibility_alias UICollectionReusableView PSCollectionReusableView;
-@compatibility_alias UICollectionViewCell PSCollectionViewCell;
-@compatibility_alias UICollectionViewLayout PSCollectionViewLayout;
-@compatibility_alias UICollectionViewFlowLayout PSCollectionViewFlowLayout;
-@compatibility_alias UICollectionViewLayoutAttributes PSCollectionViewLayoutAttributes;
-@protocol UICollectionViewDataSource <PSCollectionViewDataSource> @end
-@protocol UICollectionViewDelegate <PSCollectionViewDelegate> @end
-#endif
-
-@protocol PSCollectionViewDataSource <NSObject>
-@required
-
-- (NSInteger)collectionView:(PSCollectionView *)collectionView numberOfItemsInSection:(NSInteger)section;
-
-// The cell that is returned must be retrieved from a call to -dequeueReusableCellWithReuseIdentifier:forIndexPath:
-- (PSCollectionViewCell *)collectionView:(PSCollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath;
-
-@optional
-
-- (NSInteger)numberOfSectionsInCollectionView:(PSCollectionView *)collectionView;
-
-// The view that is returned must be retrieved from a call to -dequeueReusableSupplementaryViewOfKind:withReuseIdentifier:forIndexPath:
-- (PSCollectionReusableView *)collectionView:(PSCollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath;
-
-@end
-
-@protocol PSCollectionViewDelegate <UIScrollViewDelegate>
-@optional
-
-// Methods for notification of selection/deselection and highlight/unhighlight events.
-// The sequence of calls leading to selection from a user touch is:
-//
-// (when the touch begins)
-// 1. -collectionView:shouldHighlightItemAtIndexPath:
-// 2. -collectionView:didHighlightItemAtIndexPath:
-//
-// (when the touch lifts)
-// 3. -collectionView:shouldSelectItemAtIndexPath: or -collectionView:shouldDeselectItemAtIndexPath:
-// 4. -collectionView:didSelectItemAtIndexPath: or -collectionView:didDeselectItemAtIndexPath:
-// 5. -collectionView:didUnhighlightItemAtIndexPath:
-- (BOOL)collectionView:(PSCollectionView *)collectionView shouldHighlightItemAtIndexPath:(NSIndexPath *)indexPath;
-- (void)collectionView:(PSCollectionView *)collectionView didHighlightItemAtIndexPath:(NSIndexPath *)indexPath;
-- (void)collectionView:(PSCollectionView *)collectionView didUnhighlightItemAtIndexPath:(NSIndexPath *)indexPath;
-- (BOOL)collectionView:(PSCollectionView *)collectionView shouldSelectItemAtIndexPath:(NSIndexPath *)indexPath;
-- (BOOL)collectionView:(PSCollectionView *)collectionView shouldDeselectItemAtIndexPath:(NSIndexPath *)indexPath; // called when the user taps on an already-selected item in multi-select mode
-- (void)collectionView:(PSCollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath;
-- (void)collectionView:(PSCollectionView *)collectionView didDeselectItemAtIndexPath:(NSIndexPath *)indexPath;
-
-- (void)collectionView:(PSCollectionView *)collectionView didEndDisplayingCell:(PSCollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath;
-- (void)collectionView:(PSCollectionView *)collectionView didEndDisplayingSupplementaryView:(PSCollectionReusableView *)view forElementOfKind:(NSString *)elementKind atIndexPath:(NSIndexPath *)indexPath;
-
-// These methods provide support for copy/paste actions on cells.
-// All three should be implemented if any are.
-- (BOOL)collectionView:(PSCollectionView *)collectionView shouldShowMenuForItemAtIndexPath:(NSIndexPath *)indexPath;
-- (BOOL)collectionView:(PSCollectionView *)collectionView canPerformAction:(SEL)action forItemAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender;
-- (void)collectionView:(PSCollectionView *)collectionView performAction:(SEL)action forItemAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender;
-
-@end
-
-typedef NS_OPTIONS(NSUInteger, PSCollectionViewScrollPosition) {
- PSCollectionViewScrollPositionNone = 0,
-
- // The vertical positions are mutually exclusive to each other, but are bitwise or-able with the horizontal scroll positions.
- // Combining positions from the same grouping (horizontal or vertical) will result in an NSInvalidArgumentException.
- PSCollectionViewScrollPositionTop = 1 << 0,
- PSCollectionViewScrollPositionCenteredVertically = 1 << 1,
- PSCollectionViewScrollPositionBottom = 1 << 2,
-
- // Likewise, the horizontal positions are mutually exclusive to each other.
- PSCollectionViewScrollPositionLeft = 1 << 3,
- PSCollectionViewScrollPositionCenteredHorizontally = 1 << 4,
- PSCollectionViewScrollPositionRight = 1 << 5
-};
-
-#if __IPHONE_OS_VERSION_MAX_ALLOWED < 60000
-typedef NS_OPTIONS(NSUInteger, UICollectionViewScrollPosition) {
- UICollectionViewScrollPositionNone = 0,
-
- // The vertical positions are mutually exclusive to each other, but are bitwise or-able with the horizontal scroll positions.
- // Combining positions from the same grouping (horizontal or vertical) will result in an NSInvalidArgumentException.
- UICollectionViewScrollPositionTop = 1 << 0,
- UICollectionViewScrollPositionCenteredVertically = 1 << 1,
- UICollectionViewScrollPositionBottom = 1 << 2,
-
- // Likewise, the horizontal positions are mutually exclusive to each other.
- UICollectionViewScrollPositionLeft = 1 << 3,
- UICollectionViewScrollPositionCenteredHorizontally = 1 << 4,
- UICollectionViewScrollPositionRight = 1 << 5
-};
-#endif
-
-#import "PSCollectionViewController.h"
-
-/**
- Replacement for UICollectionView for iOS4/5.
- Only supports a subset of the features of UICollectionView.
- e.g. animations won't be handled.
- */
-@interface PSCollectionView : UIScrollView
-
-- (id)initWithFrame:(CGRect)frame collectionViewLayout:(PSCollectionViewLayout *)layout; // the designated initializer
-
-@property (nonatomic, retain) PSCollectionViewLayout *collectionViewLayout;
-@property (nonatomic, assign) id <PSCollectionViewDelegate> delegate;
-@property (nonatomic, assign) id <PSCollectionViewDataSource> dataSource;
-@property (nonatomic, retain) UIView *backgroundView; // will be automatically resized to track the size of the collection view and placed behind all cells and supplementary views.
-
-// For each reuse identifier that the collection view will use, register either a class or a nib from which to instantiate a cell.
-// If a nib is registered, it must contain exactly 1 top level object which is a PSCollectionViewCell.
-// If a class is registered, it will be instantiated via alloc/initWithFrame:
-- (void)registerClass:(Class)cellClass forCellWithReuseIdentifier:(NSString *)identifier;
-- (void)registerClass:(Class)viewClass forSupplementaryViewOfKind:(NSString *)elementKind withReuseIdentifier:(NSString *)identifier;
-- (void)registerNib:(UINib *)nib forCellWithReuseIdentifier:(NSString *)identifier;
-
-/*
-- (void)registerNib:(UINib *)nib forSupplementaryViewOfKind:(NSString *)kind withReuseIdentifier:(NSString *)identifier;
- */
-
-- (id)dequeueReusableCellWithReuseIdentifier:(NSString *)identifier forIndexPath:(NSIndexPath *)indexPath;
-- (id)dequeueReusableSupplementaryViewOfKind:(NSString *)elementKind withReuseIdentifier:(NSString *)identifier forIndexPath:(NSIndexPath *)indexPath;
-// These properties control whether items can be selected, and if so, whether multiple items can be simultaneously selected.
-@property (nonatomic) BOOL allowsSelection; // default is YES
-@property (nonatomic) BOOL allowsMultipleSelection; // default is NO
-
-- (NSArray *)indexPathsForSelectedItems; // returns nil or an array of selected index paths
-- (void)selectItemAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated scrollPosition:(PSCollectionViewScrollPosition)scrollPosition;
-- (void)deselectItemAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated;
-
-- (void)reloadData; // discard the dataSource and delegate data and requery as necessary
-
-- (void)setCollectionViewLayout:(PSCollectionViewLayout *)layout animated:(BOOL)animated; // transition from one layout to another
-
-// Information about the current state of the collection view.
-
-- (NSInteger)numberOfSections;
-- (NSInteger)numberOfItemsInSection:(NSInteger)section;
-
-- (PSCollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath;
-- (PSCollectionViewLayoutAttributes *)layoutAttributesForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath;
-
-- (NSIndexPath *)indexPathForItemAtPoint:(CGPoint)point;
-- (NSIndexPath *)indexPathForCell:(PSCollectionViewCell *)cell;
-
-- (PSCollectionViewCell *)cellForItemAtIndexPath:(NSIndexPath *)indexPath;
-- (NSArray *)visibleCells;
-- (NSArray *)indexPathsForVisibleItems;
-
-// Interacting with the collection view.
-
-- (void)scrollToItemAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(PSCollectionViewScrollPosition)scrollPosition animated:(BOOL)animated;
-
-// These methods allow dynamic modification of the current set of items in the collection view
-- (void)insertSections:(NSIndexSet *)sections;
-- (void)deleteSections:(NSIndexSet *)sections;
-- (void)reloadSections:(NSIndexSet *)sections;
-- (void)moveSection:(NSInteger)section toSection:(NSInteger)newSection;
-
-- (void)insertItemsAtIndexPaths:(NSArray *)indexPaths;
-- (void)deleteItemsAtIndexPaths:(NSArray *)indexPaths;
-- (void)reloadItemsAtIndexPaths:(NSArray *)indexPaths;
-- (void)moveItemAtIndexPath:(NSIndexPath *)indexPath toIndexPath:(NSIndexPath *)newIndexPath;
-
-- (void)performBatchUpdates:(void (^)(void))updates completion:(void (^)(BOOL finished))completion; // allows multiple insert/delete/reload/move calls to be animated simultaneously. Nestable.
-
-@end
View
50 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSCollectionViewCommon.h
@@ -1,50 +0,0 @@
-//
-// PSCollectionViewCommon.h
-// PSPDFKit
-//
-// Copyright (c) 2012 Peter Steinberger. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-#import <UIKit/UIKit.h>
-
-@class PSCollectionView;
-@protocol PSCollectionViewDataSource, PSCollectionViewDelegate;
-
-// Newer runtimes defines this, here's a fallback for the iOS5 SDK.
-#ifndef NS_ENUM
-#define NS_ENUM(_type, _name) _type _name; enum
-#define NS_OPTIONS(_type, _name) _type _name; enum
-#endif
-
-// Category exists in iOS6.
-#if __IPHONE_OS_VERSION_MIN_REQUIRED < 60000
-@interface NSIndexPath (PSCollectionViewAdditions)
-+ (NSIndexPath *)indexPathForItem:(NSInteger)item inSection:(NSInteger)section;
-@property (nonatomic, readonly) NSInteger item;
-@end
-#endif
-
-// compatibility
-#ifndef kCFCoreFoundationVersionNumber_iOS_6_0
-#define kCFCoreFoundationVersionNumber_iOS_6_0 788.0
-#endif
-
-// imp_implementationWithBlock changed it's type in iOS6.
-#if __IPHONE_OS_VERSION_MAX_ALLOWED < 60000
-#define PSBlockImplCast (__bridge void *)
-@interface NSDictionary(PSSubscriptingSupport)
-- (id)objectForKeyedSubscript:(id)key;
-@end
-@interface NSMutableDictionary(PSSubscriptingSupport)
-- (void)setObject:(id)obj forKeyedSubscript:(id <NSCopying>)key;
-@end
-@interface NSArray(PSSubscriptingSupport)
-- (id)objectAtIndexedSubscript:(NSUInteger)idx;
-@end
-@interface NSMutableArray(PSSubscriptingSupport)
-- (void)setObject:(id)obj atIndexedSubscript:(NSUInteger)idx;
-@end
-#else
-#define PSBlockImplCast
-#endif
View
21 ...FKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSCollectionViewController.h
@@ -1,21 +0,0 @@
-//
-// PSCollectionViewController.h
-// PSPDFKit
-//
-// Copyright (c) 2012 Peter Steinberger. All rights reserved.
-//
-
-#import "PSCollectionViewCommon.h"
-#import "PSCollectionView.h"
-
-@class PSCollectionViewLayout, PSCollectionViewController;
-
-@interface PSCollectionViewController : UIViewController <PSCollectionViewDelegate, PSCollectionViewDataSource>
-
-- (id)initWithCollectionViewLayout:(PSCollectionViewLayout *)layout;
-
-@property (nonatomic, strong) PSCollectionView *collectionView;
-
-@property (nonatomic, assign) BOOL clearsSelectionOnViewWillAppear; // defaults to YES, and if YES, any selection is cleared in viewWillAppear:
-
-@end
View
122 ...FKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSCollectionViewFlowLayout.h
@@ -1,122 +0,0 @@
-//
-// UICollectionViewFlowLayout.h
-// PSPDFKit
-//
-// Copyright (c) 2012 Peter Steinberger. All rights reserved.
-//
-
-#import "PSCollectionViewLayout.h"
-
-extern NSString *const PSCollectionElementKindSectionHeader;
-extern NSString *const PSCollectionElementKindSectionFooter;
-
-typedef NS_ENUM(NSInteger, PSCollectionViewScrollDirection) {
- PSCollectionViewScrollDirectionVertical,
- PSCollectionViewScrollDirectionHorizontal
-};
-
-#if __IPHONE_OS_VERSION_MAX_ALLOWED < 60000
-typedef NS_ENUM(NSInteger, UICollectionViewScrollDirection) {
- UICollectionViewScrollDirectionVertical,
- UICollectionViewScrollDirectionHorizontal
-};
-#endif
-
-@protocol PSCollectionViewDelegateFlowLayout <PSCollectionViewDelegate>
-@optional
-
-- (CGSize)collectionView:(PSCollectionView *)collectionView layout:(PSCollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath;
-- (UIEdgeInsets)collectionView:(PSCollectionView *)collectionView layout:(PSCollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section;
-- (CGFloat)collectionView:(PSCollectionView *)collectionView layout:(PSCollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section;
-- (CGFloat)collectionView:(PSCollectionView *)collectionView layout:(PSCollectionViewLayout*)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section;
-- (CGSize)collectionView:(PSCollectionView *)collectionView layout:(PSCollectionViewLayout*)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section;
-- (CGSize)collectionView:(PSCollectionView *)collectionView layout:(PSCollectionViewLayout*)collectionViewLayout referenceSizeForFooterInSection:(NSInteger)section;
-
-@end
-
-@interface PSCollectionViewFlowLayout : PSCollectionViewLayout
-
-@property (nonatomic) CGFloat minimumLineSpacing;
-@property (nonatomic) CGFloat minimumInteritemSpacing;
-@property (nonatomic) CGSize itemSize; // for the cases the delegate method is not implemented
-@property (nonatomic) PSCollectionViewScrollDirection scrollDirection; // default is PSCollectionViewScrollDirectionVertical
-@property (nonatomic) CGSize headerReferenceSize;
-@property (nonatomic) CGSize footerReferenceSize;
-
-@property (nonatomic) UIEdgeInsets sectionInset;
-
-/*
- Row alignment options exits in the official UICollectionView,
- bit hasn't been made public API.
-
- Here's a snippet to test this on UICollectionView:
-
- NSMutableDictionary *rowAlign = [[flowLayout valueForKey:@"_rowAlignmentsOptionsDictionary"] mutableCopy];
- rowAlign[@"UIFlowLayoutCommonRowHorizontalAlignmentKey"] = @(1);
- rowAlign[@"UIFlowLayoutLastRowHorizontalAlignmentKey"] = @(3);
- [flowLayout setValue:rowAlign forKey:@"_rowAlignmentsOptionsDictionary"];
- */
-@property(nonatomic, strong) NSDictionary *rowAlignmentOptions;
-
-@end
-
-// @steipete addition, private API in UICollectionViewFlowLayout
-extern NSString *const PSFlowLayoutCommonRowHorizontalAlignmentKey;
-extern NSString *const PSFlowLayoutLastRowHorizontalAlignmentKey;
-extern NSString *const PSFlowLayoutRowVerticalAlignmentKey;
-
-typedef NS_ENUM(NSInteger, PSFlowLayoutHorizontalAlignment) {
- PSFlowLayoutHorizontalAlignmentLeft,
- PSFlowLayoutHorizontalAlignmentCentered,
- PSFlowLayoutHorizontalAlignmentRight,
- PSFlowLayoutHorizontalAlignmentJustify // 3; default except for the last row
-};
-// TODO: settings for UIFlowLayoutRowVerticalAlignmentKey
-
-
-/*
-@interface PSCollectionViewFlowLayout (Private)
-
-- (CGSize)synchronizeLayout;
-
-// For items being inserted or deleted, the collection view calls some different methods, which you should override to provide the appropriate layout information.
-- (PSCollectionViewLayoutAttributes *)initialLayoutAttributesForFooterInInsertedSection:(NSInteger)section;
-- (PSCollectionViewLayoutAttributes *)initialLayoutAttributesForHeaderInInsertedSection:(NSInteger)section;
-- (PSCollectionViewLayoutAttributes *)initialLayoutAttributesForInsertedItemAtIndexPath:(NSIndexPath *)indexPath;
-- (PSCollectionViewLayoutAttributes *)finalLayoutAttributesForFooterInDeletedSection:(NSInteger)section;
-- (PSCollectionViewLayoutAttributes *)finalLayoutAttributesForHeaderInDeletedSection:(NSInteger)section;
-- (PSCollectionViewLayoutAttributes *)finalLayoutAttributesForDeletedItemAtIndexPath:(NSIndexPath *)indexPath;
-
-- (void)_updateItemsLayout;
-- (void)_getSizingInfos;
-- (void)_updateDelegateFlags;
-
-- (PSCollectionViewLayoutAttributes *)layoutAttributesForFooterInSection:(NSInteger)section;
-- (PSCollectionViewLayoutAttributes *)layoutAttributesForHeaderInSection:(NSInteger)section;
-- (PSCollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath usingData:(id)data;
-- (PSCollectionViewLayoutAttributes *)layoutAttributesForFooterInSection:(NSInteger)section usingData:(id)data;
-- (PSCollectionViewLayoutAttributes *)layoutAttributesForHeaderInSection:(NSInteger)section usingData:(id)data;
-
-- (id)indexesForSectionFootersInRect:(CGRect)rect;
-- (id)indexesForSectionHeadersInRect:(CGRect)rect;
-- (id)indexPathsForItemsInRect:(CGRect)rect usingData:(id)arg2;
-- (id)indexesForSectionFootersInRect:(CGRect)rect usingData:(id)arg2;
-- (id)indexesForSectionHeadersInRect:(CGRect)arg1 usingData:(id)arg2;
-- (CGRect)_frameForItemAtSection:(int)arg1 andRow:(int)arg2 usingData:(id)arg3;
-- (CGRect)_frameForFooterInSection:(int)arg1 usingData:(id)arg2;
-- (CGRect)_frameForHeaderInSection:(int)arg1 usingData:(id)arg2;
-- (void)_invalidateLayout;
-- (NSIndexPath *)indexPathForItemAtPoint:(CGPoint)arg1;
-- (PSCollectionViewLayoutAttributes *)_layoutAttributesForItemsInRect:(CGRect)arg1;
-- (CGSize)collectionViewContentSize;
-- (void)finalizeCollectionViewUpdates;
-- (PSCollectionViewLayoutAttributes *)layoutAttributesForSupplementaryViewOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath;
-- (void)_invalidateButKeepDelegateInfo;
-- (void)_invalidateButKeepAllInfo;
-- (BOOL)shouldInvalidateLayoutForBoundsChange:(CGRect)arg1;
-- (id)layoutAttributesForElementsInRect:(CGRect)arg1;
-- (void)invalidateLayout;
-- (id)layoutAttributesForItemAtIndexPath:(id)arg1;
-
-@end
-*/
View
68 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFAnnotation.h
@@ -6,8 +6,6 @@
//
#import "PSPDFKitGlobal.h"
-#import "PSPDFConverter.h"
-#import "UIColor+PSPDFKitAdditions.h"
@class PSPDFDocument;
@@ -21,24 +19,25 @@ extern NSString *const PSPDFAnnotationTypeStringInk;
// Annotations defined after the PDF standard.
typedef NS_OPTIONS(NSUInteger, PSPDFAnnotationType) {
- PSPDFAnnotationTypeUndefined = 0, // any annotation whose type couldn't be recognized.
+ PSPDFAnnotationTypeNone = 0,
PSPDFAnnotationTypeLink = 1 << 1,
PSPDFAnnotationTypeHighlight = 1 << 2, // (Highlight, Underline, StrikeOut) - PSPDFHighlightAnnotationView
- PSPDFAnnotationTypeText = 1 << 5,
- PSPDFAnnotationTypeInk = 1 << 6,
- PSPDFAnnotationTypeShape = 1 << 7, // Square, Circle
- PSPDFAnnotationTypeLine = 1 << 8,
- PSPDFAnnotationTypeNote = 1 << 9,
- PSPDFAnnotationTypeAll = ULONG_MAX
+ PSPDFAnnotationTypeText = 1 << 3,
+ PSPDFAnnotationTypeInk = 1 << 4,
+ PSPDFAnnotationTypeShape = 1 << 5, // Square, Circle
+ PSPDFAnnotationTypeLine = 1 << 6,
+ PSPDFAnnotationTypeNote = 1 << 7,
+ PSPDFAnnotationTypeUndefined = 1 << 31, // any annotation whose type couldn't be recognized
+ PSPDFAnnotationTypeAll = UINT_MAX
};
/**
- Defines a PDF annotation.
- PSPDFAnnotationParser searches the runtime for subclasses of PSPDFAnnotation and builds up a dictionary using supportedTypes.
+ Defines a PDF annotation.
+ PSPDFAnnotationParser searches the runtime for subclasses of PSPDFAnnotation and builds up a dictionary using supportedTypes.
- Don't directly make an instance of this class, use the subclasses like PSPDFNoteAnnotations, PSPDFLinkAnnotations or others. This class will return nil if initialized directly, unless with the type PSPDFAnnotationTypeUndefined.
+ Don't directly make an instance of this class, use the subclasses like PSPDFNoteAnnotations, PSPDFLinkAnnotations or others. This class will return nil if initialized directly, unless with the type PSPDFAnnotationTypeUndefined.
- Subclasses need to implement - (id)initWithAnnotationDictionary:(CGPDFDictionaryRef)annotationDictionary inAnnotsArray:(CGPDFArrayRef)annotsArray
+ Subclasses need to implement - (id)initWithAnnotationDictionary:(CGPDFDictionaryRef)annotationDictionary inAnnotsArray:(CGPDFArrayRef)annotsArray
*/
@interface PSPDFAnnotation : NSObject <NSCoding, NSCopying> {
UIColor *_color;
@@ -64,7 +63,7 @@ typedef NS_OPTIONS(NSUInteger, PSPDFAnnotationType) {
/// Initialize annotation with the corresponding PDF dictionary. Call from subclass.
- (id)initWithAnnotationDictionary:(CGPDFDictionaryRef)annotationDictionary inAnnotsArray:(CGPDFArrayRef)annotsArray type:(PSPDFAnnotationType)annotationType;
-/// To edit annotations, you need to make a copy and delete the original.
+/// Annotations that have indexOnPage >= 0 will be copied before they're modified.
/// Returns same type as current class.
- (id)copyAndDeleteOriginalIfNeeded;
@@ -79,11 +78,11 @@ typedef NS_OPTIONS(NSUInteger, PSPDFAnnotationType) {
- (NSArray *)rectsFromQuadPointsInArray:(CGPDFArrayRef)quadPointsArray;
/**
- Draw current annotation in context.
- Coordinates here are in PDF coordinate space.
+ Draw current annotation in context.
+ Coordinates here are in PDF coordinate space.
- Use PSPDFConvertViewRectToPDFRect to convert your coordinates accordingly.
- (For performance considerations, you want to do this once, not every time drawInContext is called)
+ Use PSPDFConvertViewRectToPDFRect to convert your coordinates accordingly.
+ (For performance considerations, you want to do this once, not every time drawInContext is called)
*/
- (void)drawInContext:(CGContextRef)context;
@@ -91,54 +90,61 @@ typedef NS_OPTIONS(NSUInteger, PSPDFAnnotationType) {
- (NSData *)pdfDataRepresentation;
/// Current annotation type.
-@property(nonatomic, assign, readonly) PSPDFAnnotationType type;
+@property (nonatomic, assign, readonly) PSPDFAnnotationType type;
/// If YES, the annotation will be rendered as a overlay. If NO, it will be statically rendered within the PDF content image.
/// PSPDFAnnotationTypeLink and PSPDFAnnotationTypeNote currently are rendered as overlay.
/// Currently won't work if you just set arbitrary annotations to overlay=YES.
/// If overlay is set to yes, you must also register the corresponding *AnnotationView class to render (override PSPDFAnnotationParser's annotationClassForAnnotation)
-@property(nonatomic, assign, getter=isOverlay, readonly) BOOL overlay;
+@property (nonatomic, assign, getter=isOverlay, readonly) BOOL overlay;
+
+/// Per default, annotations are editable when isWriteable returns YES.
+/// Override this to lock certain annotations (menu won't be shown)
+@property (nonatomic, assign, getter=isEditable) BOOL editable;
/// Annotation type string as defined in the PDF.
/// Usually read from the annotDict. Don't change this unless you know what you're doing.
-@property(nonatomic, copy) NSString *typeString;
+@property (nonatomic, copy) NSString *typeString;
/// Alpha value of the annotation color.
@property (nonatomic, assign) float alpha;
/// Color associated with the annotation or nil if there is no color.
/// Note: use .alpha for transparency, not the alpha value in color.
-@property(nonatomic, strong) UIColor *color;
+@property (nonatomic, strong) UIColor *color;
/// Color with added alpha value.
-@property(nonatomic, strong, readonly) UIColor *colorWithAlpha;
+@property (nonatomic, strong, readonly) UIColor *colorWithAlpha;
/// Optional. Various annotation types may contain text.
-@property(nonatomic, strong) NSString *contents;
+@property (nonatomic, strong) NSString *contents;
/// Border Line Width (only used in certain annotations)
@property (nonatomic, assign) float lineWidth;
-@property(nonatomic, assign) int indexOnPage;
+/// If indexOnPage is set, it's a native PDF annotation.
+/// If this is -1, it's not yet saved in the PDF.
+/// Annotations that have indexOnPage >= 0 will be copied before they're modified.
+@property (nonatomic, assign) int indexOnPage;
/// Some annotations may have a popupIndex. Defaults to -1.
-@property(nonatomic, assign) int popupIndex;
+@property (nonatomic, assign) int popupIndex;
/// Annotation may already be deleted locally, but not written back.
-@property(nonatomic, assign, getter=isDeleted) BOOL deleted;
+@property (nonatomic, assign, getter=isDeleted) BOOL deleted;
/// rectangle of specific annotation.
-@property(nonatomic, assign) CGRect boundingBox;
+@property (nonatomic, assign) CGRect boundingBox;
/// page for current annotation.
-@property(nonatomic, assign) NSUInteger page;
+@property (nonatomic, assign) NSUInteger page;
/// If this annotation isn't backed by the PDF, it's dirty by default.
/// After the annotation has been written to the file, this will be reset until the annotation has been changed.
-@property(nonatomic, assign, getter=isDirty) BOOL dirty;
+@property (nonatomic, assign, getter=isDirty) BOOL dirty;
/// corresponding document, weak.
-@property(nonatomic, ps_weak) PSPDFDocument *document;
+@property (nonatomic, ps_weak) PSPDFDocument *document;
@end
View
10 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFAnnotationParser.h
@@ -52,7 +52,7 @@
/// The fileType translation table is used when we encounter pspdfkit:// links.
/// Maps e.g. "mpg" to PSPDFLinkAnnotationVideo.
/// The ultimate fallback is PSPDFLinkAnnotationBrowser.
-@property(nonatomic, copy) NSDictionary *fileTypeTranslationTable;
+@property (nonatomic, copy) NSDictionary *fileTypeTranslationTable;
/// The annotation pageCache. Fills up as the documents are accessed.
@@ -73,12 +73,12 @@
/// Try to load annotations from file and set them if successful.
- (BOOL)tryLoadAnnotationsFromFileWithError:(NSError **)error;
-/// document for annotation parser. weak.
-@property(nonatomic, ps_weak, readonly) PSPDFDocumentProvider *documentProvider;
+/// document provider for annotation parser. weak.
+@property (nonatomic, ps_weak, readonly) PSPDFDocumentProvider *documentProvider;
/// Change the protocol that's used to parse pspdfkit-additions (links, audio, video)
/// Defaults to 'pspdfkit://'.
-@property(nonatomic, copy) NSString *protocolString;
+@property (nonatomic, copy) NSString *protocolString;
@end
@@ -87,7 +87,7 @@
/// Path where annotations are being saved.
/// Default's to self.documentProvider.document.cacheDirectory + "annotations.pspdfkit"
/// If set to nil, will return back to the default value.
-@property(nonatomic, copy) NSString *annotationsPath;
+@property (nonatomic, copy) NSString *annotationsPath;
/// Save annotations (returning NO + eventually an error if it fails)
- (BOOL)saveAnnotationsWithError:(NSError **)error;
View
6 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFAnnotationToolbar.h
@@ -50,13 +50,13 @@ typedef NS_ENUM(NSUInteger, PSPDFAnnotationToolbarMode) {
- (void)flashToolbar;
/// Annotation toolbar delegate.
-@property(nonatomic, strong) id<PSPDFAnnotationToolbarDelegate> delegate;
+@property (nonatomic, strong) id<PSPDFAnnotationToolbarDelegate> delegate;
/// Attached pdfController.
-@property(nonatomic, ps_weak) PSPDFViewController *pdfController;
+@property (nonatomic, ps_weak) PSPDFViewController *pdfController;
/// Active annotation toolbar mode.
-@property(nonatomic, assign) PSPDFAnnotationToolbarMode toolbarMode;
+@property (nonatomic, assign) PSPDFAnnotationToolbarMode toolbarMode;
@end
View
2  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFAnnotationView.h
@@ -15,7 +15,7 @@
@optional
/// Represented annotation this object is presenting.
-@property(nonatomic, strong) PSPDFAnnotation *annotation;
+@property (nonatomic, strong) PSPDFAnnotation *annotation;
/// page will be displayed. only available in pageCurl mode.
- (void)willShowPage:(NSUInteger)page;
View
2  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFBarButtonItem.h
@@ -89,6 +89,6 @@
@interface PSPDFCopiedBarButtonItem : UIBarButtonItem
// Link to the original barButton.
-@property(nonatomic, strong, readonly) PSPDFBarButtonItem *originalBarButtonItem;
+@property (nonatomic, strong, readonly) PSPDFBarButtonItem *originalBarButtonItem;
@end
View
2  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFBookmark.h
@@ -18,6 +18,6 @@
- (id)initWithPage:(NSUInteger)page;
/// Page reference.
-@property(nonatomic, assign) NSUInteger page;
+@property (nonatomic, assign) NSUInteger page;
@end
View
11 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFBookmarkParser.h
@@ -29,15 +29,18 @@
- (id)initWithDocument:(PSPDFDocument *)document;
/// Contains bookmarks (PSPDFBookmark) for the document.
-@property(copy) NSArray *bookmarks;
+@property (copy) NSArray *bookmarks;
-@property(ps_weak) PSPDFDocument *document;
+@property (ps_weak) PSPDFDocument *document;
/// Convenience methods. Will return NO if page is invalid or bookmark doesn't exist.
/// If you manually add bookmarks, you might need to call createToolbarAnimated to update.
- (BOOL)addBookmarkForPage:(NSUInteger)page;
- (BOOL)removeBookmarkForPage:(NSUInteger)page;
+/// Clears all bookmarks. Also deletes file.
+- (BOOL)clearAllBookmarksWithError:(NSError **)error;
+
/// Returns the bookmark if page has a bookmark.
- (PSPDFBookmark *)bookmarkForPage:(NSUInteger)page;
@@ -54,7 +57,7 @@
- (NSString *)bookmarkPath;
/// Read bookmarks out of the plist in bookmarkPath.
-- (NSArray *)loadBookmarks;
+- (NSArray *)loadBookmarksWithError:(NSError **)error;
/**
Saves the bookmark into a plist file at bookmarkPath.
@@ -63,6 +66,6 @@
We go the tricky way to make a plist so it's human-readable.
Note that PSPDFDocument confirms to NSCopying, so streaming into a keyed archiver would work too.
*/
-- (void)saveBookmarks;
+- (BOOL)saveBookmarksWithError:(NSError **)error;
@end
View
39 ...t.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFBrightnessViewController.h
@@ -0,0 +1,39 @@
+//
+// PSPDFBrightnessViewController.h
+// PSPDFKit
+//
+// Copyright (c) 2012 Peter Steinberger. All rights reserved.
+//
+
+#import "PSPDFBaseViewController.h"
+
+/// Controller to change the brightness. iOS5 and later.
+@interface PSPDFBrightnessViewController : PSPDFBaseViewController
+
+/// Enables software dimming. Defaults to YES.
+@property (nonatomic, assign) BOOL wantsSoftwareDimming;
+
+/// Enables software dimming to make the screen really dark. Defaults to YES.
+@property (nonatomic, assign) BOOL wantsAdditionalSoftwareDimming;
+
+/// Defaults to 0.3. Only relevant if wantsAdditionalSoftwareDimming is YES.
+@property (nonatomic, assign) CGFloat additionalBrightnessDimmingFactor;
+
+@end
+
+// Dimming view that is added to the main UIWindow.
+@interface PSPDFDimmingView : UIView
+@property (nonatomic, assign) CGFloat additionalBrightnessDimmingFactor;
+@end
+
+@interface PSPDFBrightnessViewController (SubclassingHooks)
+
+// Slider used to regulate brightness
+@property (nonatomic, strong) UISlider *slider;
+
+// used for additional software dimming
+- (PSPDFDimmingView *)dimmingView;
+- (PSPDFDimmingView *)addDimmingView;
+- (void)removeDimmingView;
+
+@end
View
34 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFCache.h
@@ -95,9 +95,9 @@ typedef NS_ENUM(NSInteger, PSPDFSize) {
/// Thread safe.
- (BOOL)resumeCachingForService:(id)service;
-/// Clear cache for a specific document, optionally also deletes referenced document files.
-/// This usually performs asyncronously. If you need this call to be blocking until it's done, set wait to YES.
-- (void)removeCacheForDocument:(PSPDFDocument *)aDocument deleteDocument:(BOOL)deleteDocument waitUntilDone:(BOOL)wait;
+/// Clear cache for a specific document, optionally also deletes referenced document files. Operation is synchronous.
+/// Will also delete all metadata in document.cacheDirectory
+- (BOOL)removeCacheForDocument:(PSPDFDocument *)document deleteDocument:(BOOL)deleteDocument error:(NSError **)error;
/// Clear whole (disk) cache directory. May lock until related async tasks are finished. Can be called from any thread.
- (BOOL)clearCache;
@@ -110,38 +110,38 @@ typedef NS_ENUM(NSInteger, PSPDFSize) {
/// Set up the caching strategy.
/// Defaults to PSPDFCacheOpportunistic.
-@property(assign) PSPDFCacheStrategy strategy;
+@property (nonatomic, assign) PSPDFCacheStrategy strategy;
/// Maximum number of cached documents. Default value depends on device. Only odd numbers are allowed. (1,3,5,...)
/// If you experience memory issues, set this to zero in your AppDelegate.
-@property(nonatomic, assign) NSUInteger numberOfMaximumCachedDocuments;
+@property (nonatomic, assign) NSUInteger numberOfMaximumCachedDocuments;
/// Only relevant in strategy PSPDFCacheThumbnailsAndNearPages.
-@property(assign) NSUInteger numberOfNearCachedPages;
+@property (nonatomic, assign) NSUInteger numberOfNearCachedPages;
/// JPG is almost always faster, and uses less memory (<50% of a PNG, usually). Defaults to YES.
/// If you have very text-like pages, you might want to set this to NO.
-@property(assign) BOOL useJPGFormat;
+@property (nonatomic, assign) BOOL useJPGFormat;
/// Compression strength for JPG. (PNG is lossless)
/// The higher the compression, the larger the files and the slower is decompression. Defaults to 0.9.
/// This will load the pdf and remove any jpg artifacts.
-@property(assign) CGFloat JPGFormatCompression;
+@property (nonatomic, assign) CGFloat JPGFormatCompression;
/// The interpolation level applied to thumbnail and tiny images.
/// Defaults to kCGInterpolationHigh.
-@property(assign) CGInterpolationQuality downscaleInterpolationQuality;
+@property (nonatomic, assign) CGInterpolationQuality downscaleInterpolationQuality;
/// The size of the thumbnail images used in the grid view and those shown before the full-size versions are rendered.
/// Defaults to CGSizeMake(200, 400).
-@property(assign) CGSize thumbnailSize;
+@property (nonatomic, assign) CGSize thumbnailSize;
/// The size of the images used in the scrobble bar.
/// Defaults to CGSizeMake(50, 100).
-@property(assign) CGSize tinySize;
+@property (nonatomic, assign) CGSize tinySize;
/// Cache files are saved in a subdirectory of NSCachesDirectory. Defaults to "PSPDFKit".
-@property(nonatomic, copy) NSString *cacheDirectory;
+@property (nonatomic, copy) NSString *cacheDirectory;
@end
@@ -178,10 +178,10 @@ typedef NS_ENUM(NSInteger, PSPDFSize) {
@interface PSPDFCacheQueuedDocument : NSObject
+ (PSPDFCacheQueuedDocument *)queuedDocumentWithDocument:(PSPDFDocument *)document page:(NSUInteger)page size:(PSPDFSize)size;
-@property(strong) PSPDFDocument *document;
-@property(assign) NSUInteger page; // the page index from where caching should start
-@property(assign) PSPDFSize size;
-@property(strong) NSMutableSet *pagesCached; // used to remember what pages already were attempted to be cached.
-@property(assign, getter=isCaching) BOOL caching;
+@property (nonatomic, strong) PSPDFDocument *document;
+@property (nonatomic, assign) NSUInteger page; // the page index from where caching should start
+@property (nonatomic, assign) PSPDFSize size;
+@property (nonatomic, strong) NSMutableSet *pagesCached; // used to remember what pages already were attempted to be cached.
+@property (nonatomic, assign, getter=isCaching) BOOL caching;
@end
View
4 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFColorButton.h
@@ -11,9 +11,9 @@
@interface PSPDFColorButton : UIButton
// Current color.
-@property(nonatomic, strong) UIColor *color;
+@property (nonatomic, strong) UIColor *color;
// Drawing mode.
-@property(nonatomic, assign) BOOL displayAsEllipse;
+@property (nonatomic, assign) BOOL displayAsEllipse;
@end
View
38 ...beddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFColorSelectionViewController.h
@@ -0,0 +1,38 @@
+//
+// PSPDFColorSelectionViewController.h
+// PSPDFKit
+//
+// Copyright 2012 Peter Steinberger. All rights reserved.
+//
+
+#import "PSPDFKitGlobal.h"
+
+@protocol PSPDFColorSelectionViewControllerDelegate;
+@class PSPDFSimplePageViewController;
+
+/// Flexible Color Picker.
+@interface PSPDFColorSelectionViewController : UIViewController
+
+/// Creates a new color picker on every access.
++ (PSPDFSimplePageViewController *)defaultColorPickerWithTitle:(NSString *)title delegate:(id<PSPDFColorSelectionViewControllerDelegate>)delegate;
+
+/// Returns PSPDFColorSelectionViewController.
++ (id)monoChromeSelectionViewController;
++ (id)rainbowSelectionViewController;
+
+/// Default initializer
+- (id)initWithColors:(NSArray *)colors;
+
+@property (nonatomic, ps_weak) id<PSPDFColorSelectionViewControllerDelegate> delegate;
+
+@end
+
+
+/// Delegate for the color picker.
+@protocol PSPDFColorSelectionViewControllerDelegate <NSObject>
+
+@required
+- (UIColor *)colorSelectionControllerSelectedColor:(PSPDFColorSelectionViewController *)controller;
+- (void)colorSelectionController:(PSPDFColorSelectionViewController *)controller didSelectedColor:(UIColor *)color;
+
+@end
View
26 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFColorView.h
@@ -0,0 +1,26 @@
+//
+// PSPDFColorView.h
+// PSPDFKit
+//
+// Copyright 2012 Peter Steinberger. All rights reserved.
+//
+
+#import "PSPDFKitGlobal.h"
+
+typedef NS_ENUM(NSInteger, PSPDFColorViewBorderStyle) {
+ PSPDFColorViewBorderStyleSingle = 0,
+ PSPDFColorViewBorderStyleTop,
+ PSPDFColorViewBorderStyleMiddle,
+ PSPDFColorViewBorderStyleBottom,
+};
+
+@interface PSPDFColorView : UIControl
+
++ (id)colorViewWithColor:(UIColor *)color borderStyle:(PSPDFColorViewBorderStyle)borderStyle;
+
+@property (nonatomic, strong) UIColor *color;
+@property (nonatomic) PSPDFColorViewBorderStyle borderStyle;
+
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated;
+
+@end
View
8 ...Versions/A/Headers/PSPDFPagedScrollView.h → ...rsions/A/Headers/PSPDFContentScrollView.h
@@ -1,5 +1,5 @@
//
-// PSPDFPagedScrollView.h
+// PSPDFContentScrollView.h
// PSPDFKit
//
// Copyright (c) 2011-2012 Peter Steinberger. All rights reserved.
@@ -9,14 +9,14 @@
#import "PSPDFScrollView.h"
#import "PSPDFTransitionProtocol.h"
-/// ScrollView used in pageCurl mode. iOS5 only.
-@interface PSPDFPagedScrollView : PSPDFScrollView
+/// ScrollView used in pageCurl mode. iOS5+
+@interface PSPDFContentScrollView : PSPDFScrollView
/// Initializes the PagedScrollView with a viewController.
- (id)initWithTransitionViewController:(UIViewController<PSPDFTransitionProtocol> *)viewController;
/// References the pageController
// atomic, might be accessed from a background thread during deallocation
-@property(strong, readonly) UIViewController<PSPDFTransitionProtocol> *contentController;
+@property (strong, readonly) UIViewController<PSPDFTransitionProtocol> *contentController;
@end
View
32 ...ddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFContinuousScrollViewController.h
@@ -0,0 +1,32 @@
+//
+// PSPDFContinuousScrollViewController.h
+// PSPDFKit
+//
+// Copyright (c) 2012 Peter Steinberger. All rights reserved.
+//
+
+#import "PSPDFBaseViewController.h"
+#import "PSPDFKitGlobal.h"
+#import "PSPDFTransitionProtocol.h"
+#import "PSPDFViewController.h"
+
+@class PSPDFPageView, PSPDFPagingScrollView;
+
+/// Controller for Safari-like continuous scrolling
+@interface PSPDFContinuousScrollViewController : PSPDFBaseViewController <PSPDFTransitionProtocol, UIScrollViewDelegate>
+
+/// Designated initializer.
+- (id)initWithPDFController:(PSPDFViewController *)pdfController;
+
+// Associated pdfController. (unsafe_unretained because we observe KVO on this)
+@property (nonatomic, unsafe_unretained) PSPDFViewController *pdfController;
+
+// Associated scrollview. Might be nil if transition doesn't support zooming.
+@property (nonatomic, unsafe_unretained) PSPDFContentScrollView *scrollView;
+
+/// Page padding width between single/double pages.
+@property (nonatomic, assign) CGFloat pagePadding;
+
+- (CGPoint)compensatedContentOffset;
+
+@end
View
182 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFDocument.h
@@ -9,6 +9,7 @@
#import "PSPDFCache.h"
#import "PSPDFAnnotation.h"
#import "PSPDFDocumentDelegate.h"
+#import "PSPDFDocumentProvider.h"
#import <CoreGraphics/CoreGraphics.h>
@class PSPDFTextSearch, PSPDFOutlineParser, PSPDFPageInfo, PSPDFAnnotationParser, PSPDFViewController, PSPDFTextParser, PSPDFDocumentParser, PSPDFDocumentProvider, PSPDFBookmarkParser;
@@ -22,7 +23,8 @@ typedef NS_ENUM(NSInteger, PSPDFAnnotationSaveMode) {
/// Represents a single, logical, PDF document. (one or many PDF files)
/// Can be overriden to support custom collections.
-@interface PSPDFDocument : NSObject <NSCopying, NSCoding>
+/// PSPDFDOcument is the default delegate for PSPDFDocumentProviderDelegate.
+@interface PSPDFDocument : NSObject <NSCopying, NSCoding, PSPDFDocumentProviderDelegate>
/// @name Initialization
@@ -54,7 +56,7 @@ typedef NS_ENUM(NSInteger, PSPDFAnnotationSaveMode) {
/// Delegate. Used for annotation calls.
-@property(nonatomic, ps_weak) id<PSPDFDocumentDelegate> delegate;
+@property (nonatomic, ps_weak) id<PSPDFDocumentDelegate> delegate;
/// @name File Access / Modification
@@ -86,97 +88,97 @@ typedef NS_ENUM(NSInteger, PSPDFAnnotationSaveMode) {
- (NSDictionary *)fileNamesWithDataDictionary;
/// Common base path for pdf files. Set to nil to use absolute paths for files.
-@property(nonatomic, strong) NSURL *basePath;
+@property (nonatomic, strong) NSURL *basePath;
/// Array of NSString pdf files. If basePath is set, this will be combined with the file name.
/// If basePath is not set, add the full path (as NSString) to the files.
/// Note: it's currently not possible to add the file multiple times, this will fail to display correctly.`
-@property(nonatomic, copy) NSArray *files;
+@property (nonatomic, copy) NSArray *files;
/// Usually, you have one single file URL representing the pdf. This is a shortcut setter for basePath* files. Overrides all current settings if set.
/// nil if the document was initialized with initWithData:
-@property(nonatomic, strong) NSURL *fileURL;
+@property (nonatomic, strong) NSURL *fileURL;
/// PDF data when initialized with initWithData: otherwise nil.
/// This is a shortcut to the first entry of dataArray.
-@property(nonatomic, copy, readonly) NSData *data;
+@property (nonatomic, copy, readonly) NSData *data;
/// A document can also have multiple NSData objects.
/// Note: If writing annotations is enabled, the dataArray's content will change after a save.
-@property(nonatomic, copy, readonly) NSArray *dataArray;
+@property (nonatomic, copy, readonly) NSArray *dataArray;
/// PDF dataProvider (can be used to dynamically decrypt a document)
-@property(nonatomic, strong, readonly) __attribute__((NSObject)) CGDataProviderRef dataProvider;
+@property (nonatomic, strong, readonly) __attribute__((NSObject)) CGDataProviderRef dataProvider;
/// Document title as shown in the controller.
/// If this is not set, the framework tries to extract the title from the PDF metadata.
/// If there's no metadata, the fileName is used. ".pdf" endings will be removed either way.
-@property(nonatomic, copy) NSString *title;
+@property (nonatomic, copy) NSString *title;
/// Title might need to parse the file and is potentially slow.
/// Use this to check if title is loaded and access title in a thread if not.
-@property(nonatomic, assign, readonly, getter=isTitleLoaded) BOOL titleLoaded;
+@property (nonatomic, assign, readonly, getter=isTitleLoaded) BOOL titleLoaded;
/// Access the PDF metadata of the first PDF document.
/// A PDF might not have any metadata at all.
/// See kPSPDFMetadataKeyTitle and the following defines for keys that might be set.
/// It's possible that there are keys that don't have a PSPDFKit define.
/// Loop the dictionary to find them all.
-@property(nonatomic, strong, readonly) NSDictionary *metadata;
+@property (nonatomic, strong, readonly) NSDictionary *metadata;
/// For caching, provide a *UNIQUE* uid here. (Or clear cache after content changes for same uid. Appending content is no problem)
-@property(nonatomic, copy) NSString *UID;
+@property (nonatomic, copy) NSString *UID;
/// @name Annotations
/// Annotation link extraction. Defaults to YES.
-@property(nonatomic, assign, getter=isAnnotationsEnabled) BOOL annotationsEnabled;
+@property (nonatomic, assign, getter=isAnnotationsEnabled) BOOL annotationsEnabled;
/**
- Defines the annotations that can be edited (if annotationsEnabled is set to YES)
- Set this to an empty set to disable annotation editing/creation.
+ Defines the annotations that can be edited (if annotationsEnabled is set to YES)
+ Set this to an empty set to disable annotation editing/creation.
- Defaults to PSPDFAnnotationTypeStringHighlight, PSPDFAnnotationTypeStringUnderline, PSPDFAnnotationTypeStringStrikeout, PSDFAnnotationTypeStringNote, PSPDFAnnotationTypeStringInk, PSPDFAnnotationTypeStringFreeText
+ Defaults to PSPDFAnnotationTypeStringHighlight, PSPDFAnnotationTypeStringUnderline, PSPDFAnnotationTypeStringStrikeout, PSDFAnnotationTypeStringNote, PSPDFAnnotationTypeStringInk, PSPDFAnnotationTypeStringFreeText
*/
-@property(nonatomic, strong) NSSet *editableAnnotationTypes;
+@property (nonatomic, strong) NSSet *editableAnnotationTypes;
/// Can PDF annotations be embedded?
/// Note: only evaluates the first file if multiple files are set.
/// This might block for a while since the PDF needs to be parsed to determine this.
-@property(nonatomic, assign, readonly) BOOL canEmbedAnnotations;
+@property (nonatomic, assign, readonly) BOOL canEmbedAnnotations;
/**
- Control if and where custom created PSPDFAnnotations are saved.
- Defaults to PSPDFAnnotationSaveModeEmbeddedWithExternalFileAsFallback.
+ Control if and where custom created PSPDFAnnotations are saved.
+ Defaults to PSPDFAnnotationSaveModeEmbeddedWithExternalFileAsFallback.
- Note: Currently PSPDFLinkAnnotations cannot be saved.
- (See editableAnnotationTypes for annotations that can be written)
+ Note: Currently PSPDFLinkAnnotations cannot be saved.
+ (See editableAnnotationTypes for annotations that can be written)
*/
-@property(nonatomic, assign) PSPDFAnnotationSaveMode annotationSaveMode;
+@property (nonatomic, assign) PSPDFAnnotationSaveMode annotationSaveMode;
/**
- Saves changed annotations back into the PDF sources (files/data).
+ Saves changed annotations back into the PDF sources (files/data).
- Returns NO if annotations cannot be embedded. Then most likely error is set.
- Returns YES if there are no annotations that need to be saved.
+ Returns NO if annotations cannot be embedded. Then most likely error is set.
+ Returns YES if there are no annotations that need to be saved.
- Only available in PSPDFKit Annotate.
+ Only available in PSPDFKit Annotate.
*/
- (BOOL)saveChangedAnnotationsWithError:(NSError **)error;
/// Link annotation parser class for current document.
/// Can be overridden to use a subclassed annotation parser.
/// Note: Only returns the parser for the first PDF file.
-@property(nonatomic, strong, readonly) PSPDFAnnotationParser *annotationParser;
+@property (nonatomic, strong, readonly) PSPDFAnnotationParser *annotationParser;
/**
- Shorthand to return annotation array for specified page.
- This is a shortcut method that already compensates the page, replacing this code:
+ Shorthand to return annotation array for specified page.
+ This is a shortcut method that already compensates the page, replacing this code:
- NSUInteger compensatedPage = [document compensatedPageForPage:self.page];
- PSPDFAnnotationParser *annotationParser = [document annotationParserForPage:self.page];
- NSArray *annotations = [annotationParser annotationsForPage:compensatedPage type:PSPDFAnnotationTypeAll];
+ NSUInteger compensatedPage = [document compensatedPageForPage:self.page];
+ PSPDFAnnotationParser *annotationParser = [document annotationParserForPage:self.page];
+ NSArray *annotations = [annotationParser annotationsForPage:compensatedPage type:PSPDFAnnotationTypeAll];
*/
- (NSArray *)annotationsForPage:(NSUInteger)page type:(PSPDFAnnotationType)type;
@@ -184,14 +186,14 @@ typedef NS_ENUM(NSInteger, PSPDFAnnotationSaveMode) {
- (void)addAnnotations:(NSArray *)annotations forPage:(NSUInteger)page;
/**
- Returns the annotation parser for a specific page.
- page is needed if your PSPDFDocument contains multiple PSPDFDocumentProviders.
- (thus, multiple sources like multiple files or a file and a NSData object)
+ Returns the annotation parser for a specific page.
+ page is needed if your PSPDFDocument contains multiple PSPDFDocumentProviders.
+ (thus, multiple sources like multiple files or a file and a NSData object)
- If you use [annotationParser annotationsForPage:type:] or the other methods in there,
- be sure to use a compensated page index. Pages within annotationParser are file relative.
+ If you use [annotationParser annotationsForPage:type:] or the other methods in there,
+ be sure to use a compensated page index. Pages within annotationParser are file relative.
- Use NSUInteger compensatedPage = [self compensatedPageForPage:page].
+ Use NSUInteger compensatedPage = [self compensatedPageForPage:page].
*/
- (PSPDFAnnotationParser *)annotationParserForPage:(NSUInteger)page;
@@ -245,11 +247,12 @@ typedef NS_ENUM(NSInteger, PSPDFAnnotationSaveMode) {
/// Creates internal cache for faster display. override to provide custom caching. usually called in a thread.
- (void)fillCache;
+- (void)fillPageInfoCache; // part of fillCache.
/// Path where backupable cache data like bookmarks are saved.
/// Defaults to &lt;AppDirectory&gt;/Library/PrivateDocuments/PSPDFKit. Cannot be nil.
/// Will *always* be appended by UID. Don't manually append UID.
-@property(nonatomic, copy) NSString *cacheDirectory;
+@property (nonatomic, copy) NSString *cacheDirectory;
/// Make sure 'cacheDirectory' exists. Returns error if creation is not possible.
- (BOOL)ensureCacheDirectoryExistsWithError:(NSError **)error;
@@ -257,55 +260,66 @@ typedef NS_ENUM(NSInteger, PSPDFAnnotationSaveMode) {
/// Overrides the global caching strategy in PSPDFCache.
/// Defaults to -1; which equals to the setting in PSPDFCache.
/// Set this to PSPDFCacheNothing for sensible/encrypted documents!
-@property(nonatomic, assign) PSPDFCacheStrategy cacheStrategy;
+@property (nonatomic, assign) PSPDFCacheStrategy cacheStrategy;
/// @name Design and hints for PSPDFViewController
/// If aspect ratio is equal on all pages, you can enable this for even better performance. Defaults to NO.
-@property(nonatomic, assign, getter=isAspectRatioEqual) BOOL aspectRatioEqual;
+@property (nonatomic, assign, getter=isAspectRatioEqual) BOOL aspectRatioEqual;
/// If document is displayed, returns currently active pdfController. Don't set this yourself. Optimizes caching.
// Note: doesn't use weak as this could lead to background deallocation of the controller.
-@property(nonatomic, unsafe_unretained) PSPDFViewController *displayingPdfController;
+@property (nonatomic, unsafe_unretained) PSPDFViewController *displayingPdfController;
/// @name Password Protection and Security
-/// Passes a password to unlock encrypted documents.
-/// If the password is correct, this method returns YES. Once unlocked, you cannot use this function to relock the document.
-/// If you attempt to unlock an already unlocked document, one of the following occurs:
-/// If the document is unlocked with full owner permissions, unlockWithPassword: does nothing and returns YES. The password string is ignored.
-/// If the document is unlocked with only user permissions, unlockWithPassword attempts to obtain full owner permissions with the password
-/// string. If the string fails, the document maintains its user permissions. In either case, this method returns YES.
-/// After unlocking a document, you need to call reloadData on the PSPDFViewController.
+/**
+ Unlock documents with a password.
+ Only saves the password if unlocking was successful (vs setPassword that saves the password always)
+
+ If the password is correct, this method returns YES. Once unlocked, you cannot use this function to relock the document.
+
+ If you attempt to unlock an already unlocked document, one of the following occurs:
+ If the document is unlocked with full owner permissions, unlockWithPassword: does nothing and returns YES. The password string is ignored.
+ If the document is unlocked with only user permissions, unlockWithPassword attempts to obtain full owner permissions with the password string.
+ If the string fails, the document maintains its user permissions. In either case, this method returns YES.
+
+ After unlocking a document, you need to call reloadData on the PSPDFViewController.
+
+ If you're using multiple files or appendFile, all new files will be unlocked with the password.
+ This doesn't harm if the document is already unlocked.
+
+ If you have a mixture of files with multiple different passwords, you need to subclass didCreateDocumentProvider: and unlock the documentProvider directly there.
+ */
- (BOOL)unlockWithPassword:(NSString *)password;
/// Set a base password to be used for all files in this document (if the document is PDF encrypted).
-/// Note: relays the password to all files in the .files array.
+/// Relays the password to all current and future documentProviders.
/// The password will be ignored if the document is not password protected.
-@property(nonatomic, copy) NSString *password;
+@property (nonatomic, copy) NSString *password;
/// Returns YES if the document is valid (if it has at least one page)
/// Might need file operations to parse the document (slow)
-@property(nonatomic, assign, readonly, getter=isValid) BOOL valid;
+@property (nonatomic, assign, readonly, getter=isValid) BOOL valid;
/// Do the PDF digital right allow for printing?
/// Note: only evaluates the first file if multiple files are set.
-@property(nonatomic, assign, readonly) BOOL allowsPrinting;
+@property (nonatomic, assign, readonly) BOOL allowsPrinting;
/// Was the PDF file encryted at file creation time?
/// Note: only evaluates the first file if multiple files are set.
-@property(nonatomic, assign, readonly) BOOL isEncrypted;
+@property (nonatomic, assign, readonly) BOOL isEncrypted;
/// Name of the encryption filter used, e.g. Adobe.APS. If this is set, the document can't be unlocked.
/// See "Adobe LifeCycle DRM, http://www.adobe.com/products/livecycle/rightsmanagement
/// Note: only evaluates the first file if multiple files are set.
-@property(nonatomic, assign, readonly) NSString *encryptionFilter;
+@property (nonatomic, assign, readonly) NSString *encryptionFilter;
/// Has the PDF file been unlocked? (is it still locked?).
/// Note: only evaluates the first file if multiple files are set.
-@property(nonatomic, assign, readonly) BOOL isLocked;
+@property (nonatomic, assign, readonly) BOOL isLocked;
/// A flag that indicates whether copying text is allowed
/// Note: only evaluates the first file if multiple files are set.
@@ -319,13 +333,13 @@ typedef NS_ENUM(NSInteger, PSPDFAnnotationSaveMode) {
- (PSPDFTextParser *)textParserForPage:(NSUInteger)page;
/// Text extraction class for current document.
-@property(nonatomic, strong) PSPDFTextSearch *textSearch;
+@property (nonatomic, strong) PSPDFTextSearch *textSearch;
/// Get the document provider for a specific page.
- (PSPDFDocumentProvider *)documentProviderForPage:(NSUInteger)page;
/// Get an array of documentProviers to easily manage documents with multiple files.
-@property(nonatomic, strong, readonly) NSArray *documentProviders;
+@property (nonatomic, strong, readonly) NSArray *documentProviders;
/// Document Parser is per file, so might return the same parser for different pages.
/// (But we need to check as a PSPDFDocument can contain multiple files)
@@ -333,12 +347,12 @@ typedef NS_ENUM(NSInteger, PSPDFAnnotationSaveMode) {
/// Outline extraction class for current document.
/// Note: Only returns the parser for the first PDF file.
-@property(nonatomic, strong, readonly) PSPDFOutlineParser *outlineParser;
+@property (nonatomic, strong, readonly) PSPDFOutlineParser *outlineParser;
/// Manages the bookmark parser.
/// Lazily initialized, thread safe.
/// Can be customized with using overrideClassNames.
-@property(nonatomic, strong) PSPDFBookmarkParser *bookmarkParser;
+@property (nonatomic, strong) PSPDFBookmarkParser *bookmarkParser;
/// Page labels (NSString) for the current document.
/// Might be nil if PageLabels isn't set in the PDF.
@@ -364,18 +378,23 @@ typedef NS_ENUM(NSInteger, PSPDFAnnotationSaveMode) {
/// This is the perfect place to change the background fill color, e.g. you would do this for a black document:
/// renderOptions = @{kPSPDFBackgroundFillColor : [UIColor blackColor]};
/// This fixes tiny white/gray lines at the borders of a document that else might show up.
-@property(nonatomic, strong) NSDictionary *renderOptions;
+@property (nonatomic, strong) NSDictionary *renderOptions;
/// @name Object Finder
// options
-extern NSString *kPSPDFObjectsText; // Include Text.
-extern NSString *kPSPDFObjectsFullWords; // Always return full PSPDFWords. Implies kPSPDFObjectsText.
-extern NSString *kPSPDFObjectsRespectTextBlocks; // Don't jump to a different text block than the first one enountered in the pdfRect. Implies kPSPDFObjectsText.
-extern NSString *kPSPDFObjectsAnnotations; // Include annotations.
+extern NSString *const kPSPDFObjectsText; // Include Text.
+extern NSString *const kPSPDFObjectsFullWords; // Always return full PSPDFWords. Implies kPSPDFObjectsText.
+extern NSString *const kPSPDFObjectsTextBlocks; // Include text blocks, sorted after most appropriate.
+extern NSString *const kPSPDFObjectsTextBlocksIgnoreLarge; // Ignore too large text blocks (that are > 90% of a page)
+extern NSString *const kPSPDFObjectsAnnotationTypes; // Include annotations of attached type
+extern NSString *const kPSPDFObjectsAnnotationPageBounds; // Special case; used for PSPDFAnnotationTypeNote hit testing.
// Output categories
-extern NSString *kPSPDFGlyphs, *kPSPDFWords, *kPSPDFTextBlocks, *kPSPDFAnnotations;
+extern NSString *const kPSPDFGlyphs;
+extern NSString *const kPSPDFWords;
+extern NSString *const kPSPDFTextBlocks;
+extern NSString *const kPSPDFAnnotations;
/// Find objects at the current PDF point.
/// If options is nil, we assume kPSPDFObjectsText and kPSPDFObjectsFullWords.
@@ -395,25 +414,27 @@ extern NSString *kPSPDFGlyphs, *kPSPDFWords, *kPSPDFTextBlocks, *kPSPDFAnnotatio
/// e.g. add an entry of [PSPDFAnnotationParser class] / [MyCustomAnnotationParser class] as key/value pair to use the custom subclass. (MyCustomAnnotationParser must be a subclass of PSPDFAnnotationParser)
/// Throws an exception if the overriding class is not a subclass of the overridden class.
/// Note: does not get serialized when saved to disk.
-@property(nonatomic, strong) NSDictionary *overrideClassNames;
+@property (nonatomic, strong) NSDictionary *overrideClassNames;
/// Hook to modify/return a different document provider. Called each time a documentProvider is created (which is usually on first access, and cached afterwards)
+/// During PSPDFDocument lifetime, document providers might be created at any time, lazily, and destroyed when memory is low.
+/// This might be used to change the delegate of the PSPDFDocumentProvider.
- (PSPDFDocumentProvider *)didCreateDocumentProvider:(PSPDFDocumentProvider *)documentProvider;
/**
- Return URL to a thumbnail/full sized image (png; jpg preferred). Use this if you want to pre-supply rendered images.
- Returns nil in the default implementation.
+ Return URL to a thumbnail/full sized image (png; jpg preferred). Use this if you want to pre-supply rendered images.
+ Returns nil in the default implementation.
- Replaces thumbnailPathForPage from PSPDFKit v1.
+ Replaces thumbnailPathForPage from PSPDFKit v1.
- For example, you can use the fully pre-rendered images from the iPhone Simulator (or iPad) and copy them into your bundle.
- Then, you write a method that returns the file URL for those files.
+ For example, you can use the fully pre-rendered images from the iPhone Simulator (or iPad) and copy them into your bundle.
+ Then, you write a method that returns the file URL for those files.
- In PSPDFKit, files have the name "p1" (PSPDFSizeNative), "t1" (PSPDFSizeThumbnail) or "y1" (PSPDFSizeTiny).
- The '1' is the first page. Careful; the accessor here is zero-based.
- (So page:0 andSize:PSPDFSizeNative would map to the file "p1.jpg".
+ In PSPDFKit, files have the name "p1" (PSPDFSizeNative), "t1" (PSPDFSizeThumbnail) or "y1" (PSPDFSizeTiny).
+ The '1' is the first page. Careful; the accessor here is zero-based.
+ (So page:0 andSize:PSPDFSizeNative would map to the file "p1.jpg".
- There are additional checks in place, if the URL you're returning is invalid the image will be rendered on the fly.
+ There are additional checks in place, if the URL you're returning is invalid the image will be rendered on the fly.
*/
- (NSURL *)cachedImageURLForPage:(NSUInteger)page andSize:(PSPDFSize)size;
@@ -422,9 +443,14 @@ extern NSString *kPSPDFGlyphs, *kPSPDFWords, *kPSPDFTextBlocks, *kPSPDFAnnotatio
/// Note: If you return text here, text highlighting cannot be used for this page.
- (NSString *)pageContentForPage:(NSUInteger)page;
-/// Override if you want custom *page* background colors. Only displayed while loading, and when no thumbnail is yet available. Defaults to white.
+/// Override if you want custom *page* background colors. Only displayed while loading, and when no thumbnail is yet available. Defaults to backgroundColor.
+/// Will use kPSPDFBackgroundFillColor if set in renderOptions.
- (UIColor *)backgroundColorForPage:(NSUInteger)page;
+/// Default background color for pages. Can be overridden by subclassing backgroundColorForPage.
+/// Defaults to white.
+@property (nonatomic, strong) UIColor *backgroundColor;
+
@end
// metadata keys.
View
8 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFDocumentDelegate.h
@@ -8,6 +8,7 @@
#import "PSPDFKitGlobal.h"
@class PSPDFViewController;
+/// Delegate to receive events regarding PSPDFDocument (annotation saving; path resolving)
@protocol PSPDFDocumentDelegate <NSObject>
@optional
@@ -15,4 +16,11 @@
/// Allow resolving custom path tokens (Documents, Bundle are automatically resolved; you can add e.g. Book and resolve this here). Will only get called for unknown tokens.
- (NSString *)pdfDocument:(PSPDFDocument *)document resolveCustomAnnotationPathToken:(NSString *)pathToken; // return nil if unknown.
+/// Called after saving was successful.
+/// If there are no dirty annotations, delegates will not be called.
+- (void)pdfDocument:(PSPDFDocument *)document didSaveAnnotations:(NSArray *)annotations;
+
+/// Called after saving was failed. When a error occurs, annotations will not be the complete set in multi-file documents.
+- (void)pdfDocument:(PSPDFDocument *)document failedToSaveAnnotations:(NSArray *)annotations withError:(NSError *)error;
+
@end
View
6 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFDocumentLabelView.h
@@ -12,12 +12,12 @@
@interface PSPDFDocumentLabelView : UIView
/// UILabel used internally to show the text.
-@property(nonatomic, strong, readonly) UILabel *label;
+@property (nonatomic, strong, readonly) UILabel *label;
/// Margin that is between the text and this view. Defaults to 5.
-@property(nonatomic, assign) CGFloat labelMargin;
+@property (nonatomic, assign) CGFloat labelMargin;
/// Weak reference to the pdf controller. We use KVO for updates.
-@property(nonatomic, unsafe_unretained) PSPDFViewController *pdfController;
+@property (nonatomic, unsafe_unretained) PSPDFViewController *pdfController;
@end
View
8 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFDocumentParser.h
@@ -21,13 +21,13 @@
/// Saves annotations, returns error if there was a problem.
- (BOOL)saveAnnotations:(NSDictionary *)annotations withError:(NSError **)error;
-/// Attached DocumentProvider.
-@property(nonatomic, ps_weak, readonly) PSPDFDocumentProvider *documentProvider;
+/// Attached document provider.
+@property (nonatomic, ps_weak, readonly) PSPDFDocumentProvider *documentProvider;
/// Encryption Filter if one is found in the document.
-@property(nonatomic, copy, readonly) NSString *encryptionFilter;
+@property (nonatomic, copy, readonly) NSString *encryptionFilter;
/// Exposed XRef objects.
-@property(nonatomic, copy, readonly) NSArray *pageObjectNumbers;
+@property (nonatomic, copy, readonly) NSArray *pageObjectNumbers;
@end
View
63 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFDocumentProvider.h
@@ -7,11 +7,13 @@
#import "PSPDFKitGlobal.h"
-@class PSPDFTextSearch, PSPDFDocumentParser, PSPDFOutlineParser, PSPDFAnnotationParser, PSPDFDocumentProvider, PSPDFLabelParser, PSPDFDocument;
+@class PSPDFTextSearch, PSPDFTextParser, PSPDFDocumentParser, PSPDFOutlineParser, PSPDFAnnotationParser, PSPDFDocumentProvider, PSPDFLabelParser, PSPDFDocument;
-/// Delegate for writing annotations.
+/// Delegate for writing annotations.
@protocol PSPDFDocumentProviderDelegate <NSObject>
+@optional
+
/// Called before we append data to a PDF. Return NO to stop writing annotations.
- (BOOL)documentProvider:(PSPDFDocumentProvider *)documentProvider shouldAppendData:(NSData *)data;
@@ -36,39 +38,39 @@ extern NSString *PSPDFKCloseCachedDocumentRefNotification;
- (id)initWithDataProvider:(CGDataProviderRef)dataProvider document:(PSPDFDocument *)document;
/// Referenced NSURL. If this is set, data is nil.
-@property(nonatomic, strong, readonly) NSURL *fileURL;
+@property (nonatomic, strong, readonly) NSURL *fileURL;
/// Referenced NSData. If this is set, fileURL is nil.
/// NOT readonly, since we may write back annotation data.
-@property(nonatomic, strong) NSData *data;
+@property (nonatomic, strong) NSData *data;
/// Referenced dataProvider. (if data is set, or directly)
-@property(nonatomic, strong, readonly) __attribute__((NSObject)) CGDataProviderRef dataProvider;
+@property (nonatomic, strong, readonly) __attribute__((NSObject)) CGDataProviderRef dataProvider;
/// Returns a NSData representation, memory-maps files, tries to copy a CGDataProviderRef
- (NSData *)dataRepresentationWithError:(NSError **)error;
/// Weak-linked parent document.
-@property(nonatomic, ps_weak, readonly) PSPDFDocument *document;
+@property (nonatomic, ps_weak, readonly) PSPDFDocument *document;
-/// Delegate for writing annotations.
-@property(nonatomic, ps_weak) id<PSPDFDocumentProviderDelegate> delegate;
+/// Delegate for writing annotations. Is set to PSPDFDocument per default.
+@property (nonatomic, ps_weak) id<PSPDFDocumentProviderDelegate> delegate;
/// Access the CGPDFDocumentRef and locks the internal document.
///
/// Increases the internal reference count
/// We need to keep around the document when accessing a CGPDFPage. Retaining the page alone is not enough.
-- (CGPDFDocumentRef)requestDocumentRef;
+- (CGPDFDocumentRef)requestDocumentRefWithOwner:(id)owner;
/// Releases the lock on the documentRef.
/// Note: the parameter is to *check* if the returned documentRef is the same as the internal one.
-- (void)releaseDocumentRef:(CGPDFDocumentRef)documentRef;
+- (void)releaseDocumentRef:(CGPDFDocumentRef)documentRef withOwner:(id)owner;
/// Use documentRef within the block. Will be automatically cleaned up.
- (void)performBlock:(void(^)(PSPDFDocumentProvider *docProvider, CGPDFDocumentRef documentRef))documentRefBlock;
/// Iterate over all CGPDFPageRef pages. pageNumber starts at 1.
-- (void)iterateOverPageRef:(void(^)(PSPDFDocumentProvider *docProvider, CGPDFDocumentRef documentRef, CGPDFPageRef pageRef, NSUInteger pageNumber))pageRefBlock;
+- (void)iterateOverPageRef:(void(^)(PSPDFDocumentProvider *provider, CGPDFDocumentRef documentRef, CGPDFPageRef pageRef, NSUInteger page))pageRefBlock;
/// Requests a page for the current loaded document. Needs to be returned in releasePageRef.
/// pageNumber starts at 1.
@@ -82,74 +84,77 @@ extern NSString *PSPDFKCloseCachedDocumentRefNotification;
- (void)flushDocumentReference;
/// Number of pages in the PDF. Nil if source is invalid.
-@property(nonatomic, assign, readonly) NSUInteger pageCount;
+@property (nonatomic, assign, readonly) NSUInteger pageCount;
/// Unlock the PDF with a password. Returns YES on success. (File operation, might block for a bit
/// Will set .password to this password if successful.
- (BOOL)unlockWithPassword:(NSString *)password;
/// Set a password. Doesn't try to unlock the document.
-@property(nonatomic, copy) NSString *password;
+@property (nonatomic, copy) NSString *password;
/// Do the PDF digital right allow for printing?
-@property(nonatomic, assign, readonly) BOOL allowsPrinting;
+@property (nonatomic, assign, readonly) BOOL allowsPrinting;
/// A flag that indicates whether copying text is allowed
-@property(nonatomic, assign) BOOL allowsCopying;
+@property (nonatomic, assign) BOOL allowsCopying;
/// Was the PDF file encryted at file creation time?
-@property(nonatomic, assign, readonly) BOOL isEncrypted;
+@property (nonatomic, assign, readonly) BOOL isEncrypted;
/// Name of the encryption filter used, e.g. Adobe.APS. If this is set, the document can't be unlocked.
/// See "Adobe LifeCycle DRM, http://www.adobe.com/products/livecycle/rightsmanagement
-@property(nonatomic, assign, readonly) NSString *encryptionFilter;
+@property (nonatomic, assign, readonly) NSString *encryptionFilter;
/// Has the PDF file been unlocked? (is it still locked?).
-@property(nonatomic, assign, readonly) BOOL isLocked;
+@property (nonatomic, assign, readonly) BOOL isLocked;
/// Are we able to add/change annotations in this file?
/// Annotations can't be added to encrypted documents or if there are parsing errors.
-@property(nonatomic, assign, readwrite) BOOL canEmbedAnnotations;
+@property (nonatomic, assign, readwrite) BOOL canEmbedAnnotations;
- (BOOL)saveChangedAnnotationsWithError:(NSError **)error;
/// Access the PDF metadata. (might be a slow operation)
-@property(nonatomic, strong, readonly) NSDictionary *metadata;
+@property (nonatomic, strong, readonly) NSDictionary *metadata;
/// Return YES if metadata is already parsed.
-@property(nonatomic, assign, readonly, getter=isMetadataLoaded) BOOL metadataLoaded;
+@property (nonatomic, assign, readonly, getter=isMetadataLoaded) BOOL metadataLoaded;
/// Access the PDF title. (".pdf" will be trunicated)
/// Note: if there's no title in the PDF metadata, the file name will be used.
-@property(nonatomic, copy, readonly) NSString *title;
+@property (nonatomic, copy, readonly) NSString *title;
+
+/// Return a textParser for the specific document page. Page starts at 0.
+- (PSPDFTextParser *)textParserForPage:(NSUInteger)page;
/// Outline extraction class for current PDF.
/// Lazy initialized. Can be subclassed or set externally.
-@property(nonatomic, strong) PSPDFOutlineParser *outlineParser;
+@property (nonatomic, strong) PSPDFOutlineParser *outlineParser;
/// PDF parser that lists the PDF XRef structure and writes annotations.
/// Lazy initialized. Can be subclassed or set externally.
/// Parses the PDF on first access. Might be slow.
-@property(nonatomic, strong) PSPDFDocumentParser *documentParser;
+@property (nonatomic, strong) PSPDFDocumentParser *documentParser;
/// Determine if lazy-loaded documentParser is already available.
-@property(nonatomic, assign, readonly) BOOL isDocumentParserLoaded;
+@property (nonatomic, assign, readonly) BOOL isDocumentParserLoaded;
/// Link annotation parser class for current PDF.
/// Lazy initialized. Can be subclassed or set externally.
-@property(nonatomic, strong) PSPDFAnnotationParser *annotationParser;
+@property (nonatomic, strong) PSPDFAnnotationParser *annotationParser;
/// Page labels found in the current PDF.
/// Lazy initialized. Can be subclassed or set externally.
-@property(nonatomic, strong) PSPDFLabelParser *labelParser;
+@property (nonatomic, strong) PSPDFLabelParser *labelParser;
@end
@interface PSPDFDocumentProvider (PSPDFInternal)
// We need to allow writing to data to change annotations.
-@property(nonatomic, strong) NSData *data;
+@property (nonatomic, strong) NSData *data;
-@property(nonatomic, assign, readonly) BOOL hasOpenDocumentRef;
+@property (nonatomic, assign, readonly) BOOL hasOpenDocumentRef;
@end
View
6 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFDrawView.h
@@ -26,7 +26,7 @@
/// Class that allows drawing on top of a PSPDFPageView.
@interface PSPDFDrawView : UIView
-@property(nonatomic, strong, readonly) CAShapeLayer *shapeLayer;
+@property (nonatomic, strong, readonly) CAShapeLayer *shapeLayer;
@property (nonatomic, strong) UIBezierPath *path;
@property (nonatomic, strong) NSMutableArray *lines;
@@ -41,9 +41,9 @@
- (void)loadImage:(UIImage *)image;
- (BOOL)canUndo;
-- (void)undo;
+- (BOOL)undo;
- (BOOL)canRedo;
-- (void)redo;
+- (BOOL)redo;
- (void)done;
@end
View
4 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFFreeTextAnnotation.h
@@ -15,9 +15,9 @@
@interface PSPDFFreeTextAnnotation : PSPDFAnnotation
/// Font name as defined in the DA appearance string.
-@property(nonatomic, copy) NSString *fontName;
+@property (nonatomic, copy) NSString *fontName;
/// Font size as defined in the DA appearance string.
-@property(nonatomic, assign) CGFloat fontSize;
+@property (nonatomic, assign) CGFloat fontSize;
@end
View
20 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFGlyph.h
@@ -9,38 +9,38 @@
@class PSPDFFontInfo;
+// Global helper to convert glyphs to rects.
+extern NSArray *PSPDFRectsFromGlyphs(NSArray *glyphs, CGAffineTransform t, CGRect *boundingBox);
+
/// Represents a single character (glyph) on the pdf page.
/// Adobe also might reference to this as "Quad".
@interface PSPDFGlyph : NSObject
/// Frame of the glyph.
-@property(nonatomic, assign) CGRect frame;
+@property (nonatomic, assign) CGRect frame;
/// Character content (usually a single character)
-@property(nonatomic, copy) NSString *content;
+@property (nonatomic, copy) NSString *content;
/// Used font info.
-@property(nonatomic, strong) PSPDFFontInfo *font;
+@property (nonatomic, strong) PSPDFFontInfo *font;
// Set if after this glyph a \n is there.
-@property(nonatomic, assign) BOOL lineBreaker;
+@property (nonatomic, assign) BOOL lineBreaker;
/// Index set on the Glyph.
-@property(nonatomic, assign) int indexOnPage;
+@property (nonatomic, assign) int indexOnPage;
/// Compare with second glyph on the X position.
- (NSComparisonResult)compareByXPosition:(PSPDFGlyph *)glyph;
- (BOOL)isOnSameLineAs:(PSPDFGlyph *)glyph;
-@property(nonatomic, assign, readonly) CGFloat fontHeight;
+@property (nonatomic, assign, readonly) CGFloat fontHeight;
- (BOOL)isOnSameLineSegmentAs:(PSPDFGlyph *)glyph;
-// Global helper to convert glyphs to rects.
-NSArray *PSPDFRectsFromGlyphs(NSArray *glyphs, CGAffineTransform t, CGRect *boundingBox);
-
/// Used for caching during longPress event.
-@property(nonatomic, assign) CGRect cachedViewRect;
+@property (nonatomic, assign) CGRect cachedViewRect;
@end
View
28 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFGradientView.h
@@ -0,0 +1,28 @@
+//
+// PSPDFGradientView.h
+// PSPDFKit
+//
+// Copyright (c) 2012 Peter Steinberger. All rights reserved.
+//
+
+#import "PSPDFKitGlobal.h"
+
+/// Display a gradient.
+@interface PSPDFGradientView : UIView
+
+typedef NS_ENUM(NSInteger, PSPDFGradientViewDirection) {
+ PSPDFGradientViewDirectionHorizontal,
+ PSPDFGradientViewDirectionVertical
+};
+
+/// Gradient direction. Defaults to PSPDFGradientViewDirectionHorizontal.
+@property (nonatomic, assign) PSPDFGradientViewDirection direction;
+
+/// Gradient colors.
+@property (nonatomic, copy) NSArray *colors;
+
+/// Gradient location. Array of NSNumber objects that define the location of each color.
+/// Defaults to nil; which is a uniform spread.
+@property (nonatomic, copy) NSArray *locations;
+
+@end
View
2  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFGraphicsState.h
@@ -23,6 +23,6 @@
CGFloat rise;
}
-@property(nonatomic, strong) PSPDFFontInfo *font;
+@property (nonatomic, strong) PSPDFFontInfo *font;
@end
View
1  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFHighlightAnnotation.h
@@ -15,6 +15,7 @@ typedef NS_ENUM(NSInteger, PSPDFHighlightAnnotationType) {
};
/// Text Highlight Annotation (Highlight, StrikeOut, Underline)
+/// Important! If you programmatically create a highlight annotation, you need to both set the boundingBox AND the rects array. (the rects array contains boxed variants of CGRect (NSValue))
@interface PSPDFHighlightAnnotation : PSPDFAnnotation
/// Highlight subtype.
View
2  ...it.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFHighlightAnnotationView.h
@@ -12,7 +12,7 @@
@interface PSPDFHighlightAnnotationView : PSPDFLinkAnnotationBaseView
/// Embedded UIButton.
-@property(nonatomic, strong, readonly) UIButton *button;
+@property (nonatomic, strong, readonly) UIButton *button;
/// called when button is pressed.
- (void)touchDown;
View
3  PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFIconGenerator.h
@@ -18,7 +18,8 @@ typedef NS_ENUM(NSInteger, PSPDFIconType) {
PSPDFIconTypeEmail,
PSPDFIconTypeAnnotations,
PSPDFIconTypeBookmark,
- PSPDFIconTypeBookmarkActive
+ PSPDFIconTypeBookmarkActive,
+ PSPDFIconTypeBrightness
};
/// Generates various Icons on the fly and caches them for later use.
View
4 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFImageAnnotationView.h
@@ -14,9 +14,9 @@
@interface PSPDFImageAnnotationView : PSPDFLinkAnnotationBaseView
/// Image URL (to a local resource)
-@property(nonatomic, strong) NSURL *URL;
+@property (nonatomic, strong) NSURL *URL;
/// Direct access to the ImageView.
-@property(nonatomic, strong, readonly) UIImageView *imageView;
+@property (nonatomic, strong, readonly) UIImageView *imageView;
@end
View
9 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFKit.h
@@ -20,6 +20,7 @@
#import "PSPDFGlobalLock.h"
#import "PSPDFViewController.h"
#import "PSPDFViewControllerDelegate.h"
+#import "PSPDFViewController+Delegates.h"
#import "PSPDFDocument.h"
#import "PSPDFDocumentDelegate.h"
#import "PSPDFPageView.h"
@@ -32,7 +33,7 @@
#import "PSPDFPageInfo.h"
#import "PSPDFHUDView.h"
#import "PSPDFPositionView.h"
-#import "PSPDFPagedScrollView.h"
+#import "PSPDFContentScrollView.h"
#import "PSPDFPageViewController.h"
#import "PSPDFSinglePageViewController.h"
#import "PSPDFTabbedViewController.h"
@@ -53,9 +54,9 @@
#import "PSPDFScrobbleBar.h"
#import "PSPDFThumbnailGridViewCell.h"
#import "UIImage+PSPDFKitAdditions.h"
-#import "PSCollectionView.h"
-#import "PSCollectionViewCell.h"
-#import "PSCollectionViewFlowLayout.h"
+#import "PSTCollectionView.h"
+#import "PSTCollectionViewCell.h"
+#import "PSTCollectionViewFlowLayout.h"
// outline
#import "PSPDFOutlineParser.h"
View
25 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFKitGlobal.h
@@ -23,10 +23,6 @@
#define NS_OPTIONS(_type, _name) _type _name; enum
#endif
-/// If enabled, this shows some additional log data for specific features to track time.
-/// This should only be enabled for debugging.
-//#define kPSPDFBenchmark
-
extern NSString *const kPSPDFErrorDomain;
typedef NS_ENUM(NSInteger, PSPDFErrorCode) {
@@ -36,7 +32,8 @@ typedef NS_ENUM(NSInteger, PSPDFErrorCode) {
PSPDFErrorCodeFailedToLoadAnnotations = 400,
PSPDFErrorCodeFailedToWriteAnnotations = 410,
PSPDFErrorCodeOutlineParser = 500,
- PSPDFErrorUnableToConvertToDataRepresentation = 600,
+ PSPDFErrorCodeUnableToConvertToDataRepresentation = 600,
+ PSPDFErrorCodeRemoveCacheError = 700,
PSPDFErrorCodeUnknown = 900,
};