From 013d66e1d05b3ccedbb6356697f204faa5a51745 Mon Sep 17 00:00:00 2001 From: Julius Oklamcak Date: Mon, 17 Jul 2017 18:34:08 -0400 Subject: [PATCH] HOWTO.md --- .gitignore | 1 + HOWTO.md | 36 +++++++++++++++++++++ LICENSE.md | 8 ++--- README.md | 20 ++++++------ UXReader/UXReader.xcodeproj/project.pbxproj | 2 ++ 5 files changed, 52 insertions(+), 15 deletions(-) create mode 100644 HOWTO.md diff --git a/.gitignore b/.gitignore index 9006d17..4fb1a37 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .DS_Store +libpdfium.a project.xcworkspace xcuserdata Todo.txt diff --git a/HOWTO.md b/HOWTO.md new file mode 100644 index 0000000..3b10d19 --- /dev/null +++ b/HOWTO.md @@ -0,0 +1,36 @@ +### Using the UXReader PDF Framework for iOS + +#### Getting Started + +Since the framework depends on a single large binary library file (libpdfium.a), you should download +the latest [UXReader-iOS](https://github.com/vfr/UXReader-iOS/releases/download/0.1.0/UXReader-iOS.zip) +release ZIP. Once extracted, open Reader.xcworkspace in Xcode and then build and run to a device +(as the PDFium library does not support building for x86_64 simulator at this time). +Then use iTunes to sync PDF files to the sample Reader app. + +Alternatively, you can clone the project from GitHub and copy libpdfium.a from the above ZIP into +the PDFium folder inside of the UXReader project folder. + +To use the UXReader framework in your own apps, simply drag the UXReader project folder to your +Xcode workspace or project and set the dependencies to this iOS Framework to build and include +it in your app bundle. + +#### Showing a Document + +There are two classes that are required to show a document: `UXReaderDocument` and `UXReaderViewController`. +Use `#import ` to import their definitions. + +First create a UXReaderDocument object: + +`NSURL *URL = [NSURL fileURLWithPath:@"file:///path/to/user/file.pdf"];` +`UXReaderDocument *document = [[UXReaderDocument alloc] initWithURL:URL];` + +then + +`UXReaderViewController *readerViewController = [[UXReaderViewController alloc] init];` +`[readerViewController setDelegate:self]; [readerViewController setDocument:document];` +`[readerViewController setDisplayMode:UXReaderDisplayModeSinglePageScrollH];` + +now present the view controller. Please see the `-openDocumentURL:` method in +[`ReaderViewController.mm`](https://github.com/vfr/UXReader-iOS/blob/master/Reader/Reader/ReaderViewController.mm) +in the Reader sample app for details on presenting as a modal or child view controller. diff --git a/LICENSE.md b/LICENSE.md index 2696c6d..b46862c 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -UXReader +UXReader PDF Framework for iOS License Copyright © 2017 Julius Oklamcak. All rights reserved. @@ -19,13 +19,13 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --=-=-=-=-=-=-=-=- +--- -PDFium +PDFium License https://pdfium.googlesource.com/pdfium/+/master/LICENSE --=-=-=-=-=-=-=-=- +--- iOS, iPad, iPhone, iPod touch are registered trademarks of Apple Inc. All other trademarks and service marks are the properties of their diff --git a/README.md b/README.md index 3004241..474c9ea 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ on the open-source [PDFium](https://pdfium.googlesource.com/pdfium/) library. * Single page horizontal and vertical scrolling. * Double page horizontal and vertical scrolling. * Right to Left and Left to Right UI and document presentation. -* Table of Contents (aka PDF outline) extraction. +* Table of Contents (aka PDF outline or bookmark) extraction. * Page text extraction (by co-ordinates or character index). * Page links (goto page and URL). * Page labels ("Cover", "i", "ii", etc). @@ -26,16 +26,14 @@ on the open-source [PDFium](https://pdfium.googlesource.com/pdfium/) library. ### Notes The code is universal, written in Objective-C++ (works with Swift or plain -Objective-C) and does not require storyboards or NIBs (as all UI elements -are generated in code with graphics resources bundled in the framework). It -runs on iPad, iPhone and iPod touch with iOS 9.0 and up and is ready to be -fully internationalized. - -Please see the sample Reader project on how to use the UXReader framework (class -and method documentation is still on the todo list). You will also need to download -[libpdfium.a](https://github.com/vfr/UXReader-iOS/releases/download/0.1.0/libpdfium.a) -and copy it into the PDFium directory inside the UXReader project sub-directory before -building. +Objective-C) and does not require storyboards or NIBs (all UI elements are +generated in code with graphics resources bundled in the framework). It runs +on iPad, iPhone and iPod touch with iOS 9.0 and up and is ready to be fully +internationalized. + +Please see the [HOWTO](https://github.com/vfr/UXReader-iOS/blob/master/HOWTO.md) for +getting started and the sample Reader project on how to use the UXReader framework +(class and method documentation is still on the todo list). ### Contact Info diff --git a/UXReader/UXReader.xcodeproj/project.pbxproj b/UXReader/UXReader.xcodeproj/project.pbxproj index 3d1551c..60825d0 100644 --- a/UXReader/UXReader.xcodeproj/project.pbxproj +++ b/UXReader/UXReader.xcodeproj/project.pbxproj @@ -145,6 +145,7 @@ 451C82E41E6C2E5D00E6EB1C /* UXReaderPageToolbar.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = UXReaderPageToolbar.mm; path = UXReader/UXReaderPageToolbar.mm; sourceTree = ""; }; 451ECD641E6DC89A0038E89D /* UXReaderPageImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UXReaderPageImageView.h; path = UXReader/UXReaderPageImageView.h; sourceTree = ""; }; 451ECD651E6DC89A0038E89D /* UXReaderPageImageView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = UXReaderPageImageView.mm; path = UXReader/UXReaderPageImageView.mm; sourceTree = ""; }; + 4524BF981F1D5B1900E12836 /* HOWTO.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; name = HOWTO.md; path = ../HOWTO.md; sourceTree = ""; }; 452538CF1E8F59E2009D3F03 /* UXReaderThumbCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UXReaderThumbCell.h; path = UXReader/UXReaderThumbCell.h; sourceTree = ""; }; 452538D01E8F59E2009D3F03 /* UXReaderThumbCell.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = UXReaderThumbCell.mm; path = UXReader/UXReaderThumbCell.mm; sourceTree = ""; }; 452B147D1E8AECEF00C61DEE /* UXReaderOutlineView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UXReaderOutlineView.h; path = UXReader/UXReaderOutlineView.h; sourceTree = ""; }; @@ -277,6 +278,7 @@ 453DED5E1E68E7E700DEE191 /* Miscellaneous */ = { isa = PBXGroup; children = ( + 4524BF981F1D5B1900E12836 /* HOWTO.md */, 4535734D1F1BC71F00093305 /* README.md */, 4535734B1F1BC71300093305 /* LICENSE.md */, 453DED611E68E98100DEE191 /* Todo.txt */,