jlasarte
jlasarte

Reputation: 643

How can I two pages side-by-side in pdf reader when in landscape mode?

I'm trying to learn iOS development. To do that, I wanted to develop a "book" for iPad. To do this, my idea is to write a simple pdf viewer with a couple of additional features specific to the book.

I'm new to iOS development, and from what I've seen, pdfs can be tricky, so I decider to search for a library or opensource project to begin with.

I tried leaves, but then found this, which doesn't have the fancy eye-candy, but works better with big pdf's and looks promising. What I need to do, however, it to be able to display two pages side by side when the iPad is in landscape mode.

As I said, I'm new to iOS, so: can someone give me some pointer as to where should I start to modify the app? Or maybe point me to some tutorials on this, or a similar question? I don't need copy paste code (but feel free to post it, if you must, :)), just some gidance to start.

Thanks!

tl;dr: I want to modify this code so it shows two pages side by side in landscape mode, any help (tutorials on pdf in iOS, snippets of code, pointing the method I should modify) is appreciated!.

Upvotes: 1

Views: 4152

Answers (1)

Hariprasad
Hariprasad

Reputation: 1084

i dint see the links you included in your question but i have some idea how to render PDF.Use two TiledLayers side by side on a single view when you are in landscape mode.You should make your ViewController class delegate to both layers and handle content rendering in drawLayerInContext: method for both layers differently, by changing the CGPDFPageRef of the pdf document to display consecutive pages.Set the frames of the layers so that first layer occupies first half of the screen and other occupies second half.You may want to hide one layer and change the frame of other when your reader is in potrait mode.This CGDPFDocumentRef and CGcontext drawing methods will help you doing this.

Upvotes: 1

Related Questions