Permalink
Browse files

Version 2.6.0a

  • Loading branch information...
1 parent ac4d1b7 commit acbaf181c48ae9e8c524ffb8f863bd22b1e6c188 @vfr committed Sep 28, 2012
Showing with 35 additions and 1 deletion.
  1. +3 −0 .gitignore
  2. +10 −0 README.md
  3. +22 −1 Sources/ReaderDocument.m
View
@@ -0,0 +1,3 @@
+.DS_Store
+project.xcworkspace
+xcuserdata
View
@@ -174,6 +174,16 @@ Website: [http://www.vfr.org/](http://www.vfr.org/)
Email: joklamcak(at)gmail(dot)com
+If you find this code useful, or wish to fund further development,
+you can use PayPal to donate to the vfr-Reader project:
+
+<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
+<input type="hidden" name="cmd" value="_s-xclick">
+<input type="hidden" name="hosted_button_id" value="YECBZX8VRWNW6">
+<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
+<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
+</form>
+
### Acknowledgements
The PDF link support code in the ReaderContentPage class is based on
View
@@ -284,7 +284,28 @@ - (void)saveReaderDocument
- (void)updateProperties
{
- // TBD
+ CFURLRef docURLRef = (__bridge CFURLRef)self.fileURL; // File URL
+
+ CGPDFDocumentRef thePDFDocRef = CGPDFDocumentCreateWithURL(docURLRef);
+
+ if (thePDFDocRef != NULL) // Get the number of pages in the document
+ {
+ NSInteger pageCount = CGPDFDocumentGetNumberOfPages(thePDFDocRef);
+
+ _pageCount = [NSNumber numberWithInteger:pageCount];
+
+ CGPDFDocumentRelease(thePDFDocRef); // Cleanup
+ }
+
+ NSString *fullFilePath = [self.fileURL path]; // Full file path
+
+ NSFileManager *fileManager = [NSFileManager new]; // File manager instance
+
+ NSDictionary *fileAttributes = [fileManager attributesOfItemAtPath:fullFilePath error:NULL];
+
+ _fileDate = [fileAttributes objectForKey:NSFileModificationDate]; // File date
+
+ _fileSize = [fileAttributes objectForKey:NSFileSize]; // File size
}
#pragma mark NSCoding protocol methods

0 comments on commit acbaf18

Please sign in to comment.