Skip to content

Commit

Permalink
Version 1.0.1. Bugs fixed, twaks done and features added. Check the r…
Browse files Browse the repository at this point in the history
…eadme for the changelog
  • Loading branch information
nick committed Apr 27, 2011
1 parent 56c4742 commit eca2ccb
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 47 deletions.
2 changes: 1 addition & 1 deletion FastPDFKit_Sample-Info.plist
Expand Up @@ -27,7 +27,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0RC1</string>
<string>1.0.1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSMainNibFile</key>
Expand Down
60 changes: 30 additions & 30 deletions FastPdfKit Sample.xcodeproj/project.pbxproj
Expand Up @@ -7,8 +7,6 @@
objects = {

/* Begin PBXBuildFile section */
010E75E513600D80004C9B40 /* libFastPDFKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 010E75E413600D80004C9B40 /* libFastPDFKit.a */; };
010E75E613600D80004C9B40 /* libFastPDFKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 010E75E413600D80004C9B40 /* libFastPDFKit.a */; };
0157CF7C12EF16B200DDC590 /* SearchManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0157CF7312EF16B200DDC590 /* SearchManager.m */; };
0157CF7D12EF16B200DDC590 /* MiniSearchView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0157CF7512EF16B200DDC590 /* MiniSearchView.m */; };
0157CF8012EF16B200DDC590 /* SearchResultCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0157CF7912EF16B200DDC590 /* SearchResultCellView.m */; };
Expand Down Expand Up @@ -157,6 +155,8 @@
01884AB2131E95720045038F /* MenuViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 01FB0F92125CB46A002D4337 /* MenuViewController.m */; };
01884AC3131E96C50045038F /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 01884AC2131E96C50045038F /* SystemConfiguration.framework */; };
01884AC7131E96CE0045038F /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 01884AC6131E96CE0045038F /* MobileCoreServices.framework */; };
01AB0AAC13687E0F004A5E27 /* libFastPDFKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 01AB0AAB13687E0F004A5E27 /* libFastPDFKit.a */; };
01AB0AAD13687E0F004A5E27 /* libFastPDFKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 01AB0AAB13687E0F004A5E27 /* libFastPDFKit.a */; };
01B0C7B213596C2400CB3D29 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 01B0C7B113596C2400CB3D29 /* AVFoundation.framework */; };
01B0C7B413596C2A00CB3D29 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 01B0C7B313596C2A00CB3D29 /* AVFoundation.framework */; };
01B9166013214E1D00D517A6 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 9598FDD312337F24008D7198 /* Icon.png */; };
Expand Down Expand Up @@ -225,8 +225,6 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
010E75E413600D80004C9B40 /* libFastPDFKit.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libFastPDFKit.a; sourceTree = "<group>"; };
010E75E713600DAC004C9B40 /* MFDocumentOverlayDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFDocumentOverlayDataSource.h; sourceTree = "<group>"; };
0157CF7212EF16B200DDC590 /* SearchManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SearchManager.h; sourceTree = "<group>"; };
0157CF7312EF16B200DDC590 /* SearchManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SearchManager.m; sourceTree = "<group>"; };
0157CF7412EF16B200DDC590 /* MiniSearchView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MiniSearchView.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -340,17 +338,19 @@
01884AA2131E950A0045038F /* XMLParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XMLParser.m; sourceTree = "<group>"; };
01884AC2131E96C50045038F /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
01884AC6131E96CE0045038F /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; };
019E90AF135E0F3900541DE4 /* MFAudioPlayerViewProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFAudioPlayerViewProtocol.h; sourceTree = "<group>"; };
019E90B0135E0F3900541DE4 /* MFAudioProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFAudioProvider.h; sourceTree = "<group>"; };
019E90B1135E0F3900541DE4 /* MFDocumentManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFDocumentManager.h; sourceTree = "<group>"; };
019E90B3135E0F3900541DE4 /* MFDocumentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFDocumentViewController.h; sourceTree = "<group>"; };
019E90B4135E0F3900541DE4 /* MFDocumentViewControllerDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFDocumentViewControllerDelegate.h; sourceTree = "<group>"; };
019E90B5135E0F3900541DE4 /* MFOverlayDrawable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFOverlayDrawable.h; sourceTree = "<group>"; };
019E90B6135E0F3900541DE4 /* MFOverlayTouchable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFOverlayTouchable.h; sourceTree = "<group>"; };
019E90B7135E0F3900541DE4 /* MFPDFOutlineEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFPDFOutlineEntry.h; sourceTree = "<group>"; };
019E90B8135E0F3900541DE4 /* mfprofile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mfprofile.h; sourceTree = "<group>"; };
019E90B9135E0F3900541DE4 /* MFTextItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFTextItem.h; sourceTree = "<group>"; };
019E90BA135E0F3900541DE4 /* Stuff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Stuff.h; sourceTree = "<group>"; };
01AB0A9F13687BB0004A5E27 /* MFAudioPlayerViewProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFAudioPlayerViewProtocol.h; sourceTree = "<group>"; };
01AB0AA013687BB0004A5E27 /* MFAudioProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFAudioProvider.h; sourceTree = "<group>"; };
01AB0AA113687BB0004A5E27 /* MFDocumentManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFDocumentManager.h; sourceTree = "<group>"; };
01AB0AA213687BB0004A5E27 /* MFDocumentOverlayDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFDocumentOverlayDataSource.h; sourceTree = "<group>"; };
01AB0AA313687BB0004A5E27 /* MFDocumentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFDocumentViewController.h; sourceTree = "<group>"; };
01AB0AA413687BB0004A5E27 /* MFDocumentViewControllerDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFDocumentViewControllerDelegate.h; sourceTree = "<group>"; };
01AB0AA513687BB0004A5E27 /* MFOverlayDrawable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFOverlayDrawable.h; sourceTree = "<group>"; };
01AB0AA613687BB0004A5E27 /* MFOverlayTouchable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFOverlayTouchable.h; sourceTree = "<group>"; };
01AB0AA713687BB0004A5E27 /* MFPDFOutlineEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFPDFOutlineEntry.h; sourceTree = "<group>"; };
01AB0AA813687BB0004A5E27 /* mfprofile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mfprofile.h; sourceTree = "<group>"; };
01AB0AA913687BB0004A5E27 /* MFTextItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFTextItem.h; sourceTree = "<group>"; };
01AB0AAA13687BB0004A5E27 /* Stuff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Stuff.h; sourceTree = "<group>"; };
01AB0AAB13687E0F004A5E27 /* libFastPDFKit.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libFastPDFKit.a; sourceTree = "<group>"; };
01B0C7B113596C2400CB3D29 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
01B0C7B313596C2A00CB3D29 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
01B916791321507500D517A6 /* SearchViewControllerDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SearchViewControllerDelegate.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -419,7 +419,7 @@
01884AC3131E96C50045038F /* SystemConfiguration.framework in Frameworks */,
01884AC7131E96CE0045038F /* MobileCoreServices.framework in Frameworks */,
01E2BC37133D14BB00CCED33 /* MediaPlayer.framework in Frameworks */,
010E75E613600D80004C9B40 /* libFastPDFKit.a in Frameworks */,
01AB0AAD13687E0F004A5E27 /* libFastPDFKit.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -434,7 +434,7 @@
950B37C4125CBEA5007BDDA1 /* QuartzCore.framework in Frameworks */,
950B37D0125CBEC4007BDDA1 /* UIKit.framework in Frameworks */,
0174E2B012EF24CA003699A8 /* CoreText.framework in Frameworks */,
010E75E513600D80004C9B40 /* libFastPDFKit.a in Frameworks */,
01AB0AAC13687E0F004A5E27 /* libFastPDFKit.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -444,18 +444,18 @@
01448A0D134C70A700FD83D8 /* headers */ = {
isa = PBXGroup;
children = (
010E75E713600DAC004C9B40 /* MFDocumentOverlayDataSource.h */,
019E90AF135E0F3900541DE4 /* MFAudioPlayerViewProtocol.h */,
019E90B0135E0F3900541DE4 /* MFAudioProvider.h */,
019E90B1135E0F3900541DE4 /* MFDocumentManager.h */,
019E90B3135E0F3900541DE4 /* MFDocumentViewController.h */,
019E90B4135E0F3900541DE4 /* MFDocumentViewControllerDelegate.h */,
019E90B5135E0F3900541DE4 /* MFOverlayDrawable.h */,
019E90B6135E0F3900541DE4 /* MFOverlayTouchable.h */,
019E90B7135E0F3900541DE4 /* MFPDFOutlineEntry.h */,
019E90B8135E0F3900541DE4 /* mfprofile.h */,
019E90B9135E0F3900541DE4 /* MFTextItem.h */,
019E90BA135E0F3900541DE4 /* Stuff.h */,
01AB0A9F13687BB0004A5E27 /* MFAudioPlayerViewProtocol.h */,
01AB0AA013687BB0004A5E27 /* MFAudioProvider.h */,
01AB0AA113687BB0004A5E27 /* MFDocumentManager.h */,
01AB0AA213687BB0004A5E27 /* MFDocumentOverlayDataSource.h */,
01AB0AA313687BB0004A5E27 /* MFDocumentViewController.h */,
01AB0AA413687BB0004A5E27 /* MFDocumentViewControllerDelegate.h */,
01AB0AA513687BB0004A5E27 /* MFOverlayDrawable.h */,
01AB0AA613687BB0004A5E27 /* MFOverlayTouchable.h */,
01AB0AA713687BB0004A5E27 /* MFPDFOutlineEntry.h */,
01AB0AA813687BB0004A5E27 /* mfprofile.h */,
01AB0AA913687BB0004A5E27 /* MFTextItem.h */,
01AB0AAA13687BB0004A5E27 /* Stuff.h */,
);
name = headers;
sourceTree = "<group>";
Expand Down Expand Up @@ -617,7 +617,7 @@
01CC21CB12B907AF00E77E6E /* Library */ = {
isa = PBXGroup;
children = (
010E75E413600D80004C9B40 /* libFastPDFKit.a */,
01AB0AAB13687E0F004A5E27 /* libFastPDFKit.a */,
01448A0D134C70A700FD83D8 /* headers */,
01E3A3021309C3D9008BB483 /* cidf */,
);
Expand Down
11 changes: 11 additions & 0 deletions FastPdfKit/MFDocumentManager.h
Expand Up @@ -20,6 +20,7 @@
CGPDFDocumentRef document;
NSLock * lock;
NSURL * url;
CGDataProviderRef provider;

NSString * resourceFolder; /* If nil, will default to Documents folder */

Expand All @@ -38,6 +39,11 @@
// These method are used internally.
-(CGImageRef)createImageFromPDFPagesLeft:(NSInteger)leftPage andRight:(NSInteger)rightPage size:(CGSize)size andScale:(CGFloat)scale useLegacy:(BOOL)legacy;
-(CGImageRef)createImageFromPDFPage:(NSInteger)page size:(CGSize)size andScale:(CGFloat)scale useLegacy:(BOOL)legacy;

-(CGImageRef)createImageFromPDFPagesLeft:(NSInteger)leftPage andRight:(NSInteger)rightPage size:(CGSize)size andScale:(CGFloat)scale useLegacy:(BOOL)legacy showShadow:(BOOL)shadow andPadding:(CGFloat)padding;
-(CGImageRef)createImageFromPDFPage:(NSInteger)page size:(CGSize)size andScale:(CGFloat)scale useLegacy:(BOOL)legacy showShadow:(BOOL)shadow andPadding:(CGFloat)padding;


-(void)drawPageNumber:(NSInteger)pageNumber onContext:(CGContextRef)ctx;
-(void)getCropbox:(CGRect *)cropbox andRotation:(int *)rotation forPageNumber:(NSInteger)pageNumber;

Expand All @@ -61,6 +67,11 @@
Initializer. You can also use the factory method above.
*/
-(id)initWithFileUrl:(NSURL*)anUrl;

/**
Initializer with data provider.
*/
-(id)initWithDataProvider:(CGDataProviderRef)dataProvider;

/**
Check if a document is encrypted and blocked by a password or not.
Expand Down
25 changes: 24 additions & 1 deletion FastPdfKit/MFDocumentViewController.h
Expand Up @@ -71,12 +71,25 @@
BOOL zoomInOnDoubleTapEnabled;
BOOL documentInteractionEnabled;
BOOL overlayEnabled;

BOOL showShadow;
CGFloat padding;

}

@property (assign) NSObject<MFDocumentViewControllerDelegate> *documentDelegate;
@property (readonly) MFDocumentManager * document;

/**
Set this flag to NO if you don't want the dropdown shadow under the pages. Default is YES.
*/
@property (nonatomic,readwrite) BOOL showShadow;

/**
Set the amount of minimum padding between the pages and the screen edge. Default is 5.0. Values are clipped between 0 and 100.
*/
@property (nonatomic,readwrite) CGFloat padding;

/**
Add an Overlay Datasource.
*/
Expand All @@ -92,12 +105,22 @@
*/
-(void)reloadOverlay;

/*
/**
This will return the appropriate zoom level to perfectly zoom onto an annotation. If return 0, there's no available
page data to compute the zoom yet.
*/
-(float)zoomLevelForAnnotationRect:(CGRect)rect ofPage:(NSUInteger)page;

/**
Return the zoom scale of the page scroll view.
*/
-(float)zoomScale;

/**
Return the offset of the page scroll view.
*/
-(CGPoint)zoomOffset;

/**
Set the starting page of the document. It is valid only after initialization and before the view is
displayed on the screen. Tipically you want to set this just after the init of the viewController.
Expand Down
Binary file modified FastPdfKit/libFastPDFKit.a
Binary file not shown.
30 changes: 15 additions & 15 deletions FastPdfKit_Kiosk-Info.plist
Expand Up @@ -2,36 +2,36 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDisplayName</key>
<string>FastPdfKit Kiosk</string>
<key>CFBundleName</key>
<string>$[PRODUCT_NAME]</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>Application requires iPhone environment</key>
<true/>
<key>Icon alread includes gloss effects</key>
<true/>
<key>Icon files</key>
<array>
<string>Icon.png</string>
<string>Icon72.png</string>
<string>Icon144.png</string>
</array>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDisplayName</key>
<string>FastPdfKit Kiosk</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.mobfarm.fastpdfkitkiosk</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$[PRODUCT_NAME]</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0RC1</string>
<string>1.0.1</string>
<key>Icon alread includes gloss effects</key>
<true/>
<key>Icon files</key>
<array>
<string>Icon.png</string>
<string>Icon72.png</string>
<string>Icon144.png</string>
</array>
<key>NSMainNibFile</key>
<string>MainWindow_Kiosk</string>
</dict>
Expand Down
8 changes: 8 additions & 0 deletions README.md
Expand Up @@ -2,6 +2,14 @@

This repository contains the FastPdfKit library with a sample project. This library allows you to add some of the features of the [FastPdf application](http://fastpdf.eu) to your own app, allowing it to support pdf documents. For more information, see [the FastPdfKit website](http://fastpdfkit.com).

### Update: 1.0.1 (Apr 27th, 2011)

* Replaced URLForResource with pathForResources for 3.X compatibility;
* Added (float)zoomScale and (CGPoint)zoomOffset methods to MFDocumentViewController to get zoom position;
* Added support for CGPDFDocumentCreateWithProvider with method initWithDataProvider:(CGDataProviderRef)provider;
* Option to remove shadow and render the page fullscreen on MFDocumentViewController using (float)padding and (BOOL)showShadow methods;
* Fixed another crash with search results.

### Update: 1.0 (Apr 19th, 2011)

* Fixed ignored optional flag for the didChangeMode: callback.
Expand Down

0 comments on commit eca2ccb

Please sign in to comment.