Implement VFR Reader inside another view

I am trying to add PDF viewing capabilities to my iPad application using the VFR Reader code.

I can use an existing ReaderViewController to render Reader as a full-screen page using the following code:

ReaderDocument *document = [ReaderDocument withDocumentFilePath:file password:nil];
if (document != nil)
{
    ReaderViewController *readerViewController = [[ReaderViewController alloc] initWithReaderDocument:document];
    // ...
    [self presentModalViewController:readerViewController animated:YES];
}

which works very well.

However, I would like to have other things around the PDF (like a permanent display panel with buttons on the top, for example), so ideally I would like the Reader view to be in my own view.

I am new to iOS programming and cannot figure out how to do this. Can someone point me in the right direction and tell me what I need to do in order to have my own view with VFR Reader in a subview?

+3
source
1

, . , .

ViewController, xib UIView PDF, viewDidLoad:

// Create the sub-ViewController, the VFR Reader ViewController
ReaderDocument *document = [ReaderDocument withDocumentFilePath:pdfFile password:nil];
_readerViewController = [[ReaderViewController alloc] initWithReaderDocument:document];

// Pass on the required delegate for handling the close button
_readerViewController.delegate = self.delegate;

// Add the VFR Reader as a child
[self addChildViewController:_readerViewController];
[self.view addSubview:_readerViewController.view];
// Set the location of the VFR Reader to the same as the placeholder view
_readerViewController.view.frame =  self.pdfPlaceholder.frame; 
[_readerViewController didMoveToParentViewController:self];
+5

All Articles