Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have added a <a href="https://github.com/vfr/Reader" rel="nofollow">https://github.com/vfr/Reader</a> PDF Reader to ChildBrowser. It works super great!</p> <p>Current components version: Child Browser for Cordova 2.2.0</p> <p>Edit the ChildBrowserCommand.h:</p> <pre><code>#import &lt;Cordova/CDVPlugin.h&gt; #import "ChildBrowserViewController.h" #import "ReaderDemoController.h" #import "ReaderViewController.h" @interface ChildBrowserCommand : CDVPlugin &lt;ChildBrowserDelegate, ReaderViewControllerDelegate&gt;{} @property (nonatomic, strong) ChildBrowserViewController* childBrowser; @property (nonatomic, strong) ReaderDemoController* reader; - (void)showWebPage:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; - (void)onChildLocationChange:(NSString*)newLoc; @end </code></pre> <p>IN THE .M FILE 1)<code>@synthesize reader;</code></p> <p>2) </p> <pre><code>- (void)showWebPage:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options { NSString* url = (NSString*)[arguments objectAtIndex:0]; if([url hasSuffix:@".pdf"]) { NSString *phrase = nil; // Document password (for unlocking most encrypted PDF files) ReaderDocument *document = [ReaderDocument withDocumentFilePath:url password:phrase]; ReaderViewController *readerViewController = [[ReaderViewController alloc] initWithReaderDocument:document];' readerViewController.delegate = self; // Set the ReaderViewController delegate to self readerViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; readerViewController.modalPresentationStyle = UIModalPresentationFullScreen; [self.viewController presentModalViewController:readerViewController animated:YES]; } else { if (self.childBrowser == nil) { #if __has_feature(objc_arc) self.childBrowser = [[ChildBrowserViewController alloc] initWithScale:NO]; NSLog(@"HAS ARC"); #else self.childBrowser = [[[ChildBrowserViewController alloc] initWithScale:NO] autorelease]; NSLog(@"NO ARC"); #endif self.childBrowser.delegate = self; self.childBrowser.orientationDelegate = self.viewController; } [self.viewController presentModalViewController:childBrowser animated:YES]; [self.childBrowser loadURL:url]; } } </code></pre> <p>3) </p> <pre><code>-(void)dismissReaderViewController:(ReaderViewController *)viewController{ NSLog(@"The delegate to dismiss pdf reader was called"); [self.viewController dismissModalViewControllerAnimated:YES];} </code></pre> <p>4) Copy everything from the Reader to our projects, add all Frameworks needed</p> <p>Enjoy. Don't forget to switch on the ARC for the Reader</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload