brow / leaves Goto Github PK
View Code? Open in Web Editor NEWA page-turning interface for iOS apps
License: Other
A page-turning interface for iOS apps
License: Other
It looks like the contexts used in the cache only support a scale of 1.0 - I've been trying to set it to 2.0 when on the iPhone 4 but to no avail. I'm doing pretty standard drawing in the CGContextRef, but it doesn't seem to scale on its own. Is there something else I need to do, perhaps to some of the layers in Leaves?
I tried copying pieces of the code from the touchesEnded:withEvent: method, but only the forward page turn is working. Any way to do this? I basically want it to simulate the user touching the side of the screen. Thanks.
The init method in the LeavesViewController is not using the designated initializer of the UIViewController superclass. As a result, an infinite loop results when a subclass of LeavesViewController is loaded from a NIB.
See the documentation for [NSObject init] where it discusses how to "prevent the possibility of an infinite loop" (http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSObject_Class/Reference/Reference.html#//apple_ref/doc/uid/20000050-init).
I forked it to http://GitHub.com/Rob-S/leaves and used the same pattern for LeavesViewController that was already being used in LeavesView. I also submitted a "Pull Request" to "brow", but I'm not sure how that works or how to check on its status.
Thanks in advance.
Rob Simpson
http://Lnkd.com?24
Hi all,
I am working on leaves project for rendering images(applying page curl effect).I am successful in getting the page curl effect in Portrait Mode and unable to get two-page landscape view with two images side by side.could some one suggest me what should be done as landscape mode is locked when i rotate screen rotation.And also provide some sample project for getting two-page landscape view with images side by side.
Thanks for the assistance.
Regards,
kaushik
Observed a weird issue. Scanned documents are not rendering. We can't see any content. But when we zoom in/out, we are able to see the content but content is upside down (90 degrees) to actual document.
Could you please help here.
I would like the app to open in the middle of the order of pages. So if there were only 3 pages I would like it to open on 2nd. Any Ideas on the best way to do this?
Thanks!
The code works well with certain PDFs but not with all PDF.
Here is the list of errors which comes when parsing the PDF and resulting in to an empty white page.
Errors :
FlateDecode: decoding error: incorrect header check.
invalid Contents': not a stream or array. missing or invalid arguments for color operator. stack underflow: popping past mark. font
F28' not found in document.
font `F168' not found in document.
Do any one has idea for this?
Is there a way to render pdf during zooming? my pdf lose quality while zooming. I tried CATiledView but the iOS crashes due to memory fault.
In the examples project, every page is rendered using core graphics. I have a UIView want to displaying in the next page, it's a grid view layout page. How to make it to show at the next page in the - (void)renderPageAtIndex:(NSUInteger)index inContext:(CGContextRef)ctx method?
Is it possible to use some goto function or something like to show wanted pdf page?
hi all:
new bee here.
the leaves demo is good for me.
Is any method to change the back image (or color) when the page fliping?
I want let the page flips just like the ibooks.
any suggest?
thanks
Hi all,
we face an issue which has been not reported yet.
We deployed the application in to iPhone , in portrait mode the zooming doesn't work properly.
Right page overlaps the left page , but in iPad the issue is not occurring.
Regards
How can i load pdf url?
When I zoom in the pdf and then rotate to landscape to portrait or portrait to landscpae and the double tap to go to the actual size of the PDF, it shows the blank white space in the PDF.
Please let me know if I can fix this issue.
Thanks,
UPT
Hi,
How to enable zooming option.
Hi, thank you for your work.
I wanted ask you how i can implement the zoom of pdf?
thanks
i need to use the same here in right to left project like hebrew and arabic so the pdf should flip from left to right not right to left like it happen now.. i tried to figure out how to make it but it's a bit confusing.. thanks sir for your effort anyway it helps me alot :)
Hi! I'm debugging my application on iOS 4.2 GM seed, and I obtain the following error on the simulator console:
: CGContextClipToRect: invalid context 0x0
: CGContextGetClipBoundingBox: invalid context 0x0
: CGContextConcatCTM: invalid context 0x0
: CGContextDrawImage: invalid context 0x0
: CGBitmapContextCreateImage: invalid context 0x0
: CGContextClipToRect: invalid context 0x0
: CGContextGetClipBoundingBox: invalid context 0x0
: CGContextConcatCTM: invalid context 0x0
: CGContextDrawImage: invalid context 0x0
: CGBitmapContextCreateImage: invalid context 0x0
Error seems issued by LeavesCache.m on the following member function
I just start to debug the application, so these are just my first impressions.
Hope to a fix soon, or maybe an hint to fix the so problem so I'll be able to commit the fix.
Thx,
Diego
i have a simple uiview hierarchy, a uiimageview for background and inside this view an uiimageview for display pages
how can i specify which uiview i need to animate?
thanks
If we put more content, could we scroll down or up the page?
*** _NSAutoreleaseNoPool(): Object 0x126460 of class NSCFData autoreleased with no pool in place - just leaking
Stack: XXXX...XX
the main.m is same as general. Only thing i do is try another PDF with 133 page and load it to my iPad. Anyone got the same problem..?
Hi
While double tapping in the left hand side the CURL-Animation gets stuck up in the corner and not working.Can you get me the solution for this .
Thanks
I'm using rodrigo's leaves version and in iPad 5.0 it's too slow when changing the pages in landscape mode. Did anyone solve this?
Thanks in advance
I design a quotes app.All quotes are loaded in table view,When i click a table cell,Each quotes are loaded in leaves view with one by one.Then turn next page ,next quotes should be displayed in next page.Kindly answer my question.
Hello,
I am getting an error when zooming the image view in the simulator. Is anyone else having this issue?
..joe..
Hi Brow, thanks for sharing your projects .
I tested your project in a real device (Iphone4) with 12 more images in the Image Example mode and I think uncache you are doing is not sufficient, the images are kept in memory in another step. If you run Instruments/Allocations you can see how the liveBytes grow until you have gone throw all the images. You can see some info about this object's allocation, like Responsible Library = ImageIO or Responsible Caller = ImageIO_Malloc. However I cant fix it so far ... your help would be really appreciate it.
Thanks
The project is bombing out at 'setPageSize' when running on several simulated devices.
I have integrated Leaves in the App which reads my PDF files from XML. But the Font size of the PDF is very less.I would like to know how to increase the Text or font size of the PDF Files.
Thanks in Advance.
I added the code to my xcode project. When I go to the view where my .pdf is suppose to be in the simulator, the pdf does not show up. I can swipe the pages (the animation swipe works) but I'm swiping blank pages. Anyone have any idea on what I could be doing wrong?
Any help would greatly be appreciated.
Thanks alot
I'm implementing leaves with Images. It was fine with upto ios6 but when I'm running this app in ios7 its going to crash. Following is the crash report of my app
2013-10-07 12:57:43.524 Books[1950:a0b] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* setObjectForKey: object cannot be nil (key: 0)'
*** First throw call stack:
(
0 CoreFoundation 0x03c315e4 exceptionPreprocess + 180
1 libobjc.A.dylib 0x02c8f8b6 objc_exception_throw + 44
2 CoreFoundation 0x03cbb578 -[__NSDictionaryM setObject:forKey:] + 888
3 Books 0x0001c74d -[LeavesCache cachedImageForPageIndex:] + 317
4 Books 0x0000dbc6 -[LeavesView getImages] + 230
5 Books 0x00010bd0 -[LeavesView setCurrentPageIndex:] + 176
6 Books 0x0000dacb -[LeavesView reloadData] + 171
7 Books 0x00016774 -[LeavesViewController viewDidLoad] + 244
8 UIKit 0x00f909a8 -[UIViewController loadViewIfRequired] + 696
9 UIKit 0x00f90c44 -[UIViewController view] + 35
10 UIKit 0x00faaa72 -[UINavigationController _startCustomTransition:] + 778
11 UIKit 0x00fb7757 -[UINavigationController _startDeferredTransitionIfNeeded:] + 688
12 UIKit 0x00fb8349 -[UINavigationController __viewWillLayoutSubviews] + 57
13 UIKit 0x010f139d -[UILayoutContainerView layoutSubviews] + 213
14 UIKit 0x00ee7dd7 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
15 libobjc.A.dylib 0x02ca181f -[NSObject performSelector:withObject:] + 70
16 QuartzCore 0x0200a72a -[CALayer layoutSublayers] + 148
17 QuartzCore 0x01ffe514 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
18 QuartzCore 0x01ffe380 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
19 QuartzCore 0x01f66156 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
20 QuartzCore 0x01f674e1 _ZN2CA11Transaction6commitEv + 393
21 QuartzCore 0x01f67bb4 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
22 CoreFoundation 0x03bf953e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 30
23 CoreFoundation 0x03bf948f __CFRunLoopDoObservers + 399
24 CoreFoundation 0x03bd73b4 __CFRunLoopRun + 1076
25 CoreFoundation 0x03bd6b33 CFRunLoopRunSpecific + 467
26 CoreFoundation 0x03bd694b CFRunLoopRunInMode + 123
27 GraphicsServices 0x035b99d7 GSEventRunModal + 192
28 GraphicsServices 0x035b97fe GSEventRun + 104
29 UIKit 0x00e7d94b UIApplicationMain + 1225
30 Books 0x0001c21d main + 125
31 libdyld.dylib 0x04ae6725 start + 0
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
And it's coming under following method
xCode 4.6.3 created new project. When loading the app or changing orientation the page cache is not updated, resulting on load the first 3 pages are initially blank until you page to page 5, same with a change to orientation, but instead of blank I have the the previous orientation's pages.
Is there a delegate issue with stroryboards? I am using the original scene and the ViewController is a subclass of LeavesViewController.
I modified a version of this to use with an app on the iPad. It would work in the simulator, but crashed on the iPad. I found that the problem was that the CGImageRef was being released, then passed back in - (CGImageRef) imageForPageIndex:(NSUInteger)pageIndex. Also there was a call to [UIImage imageWithCGImage:] that was not needed. Here is what my code now looks like
(CGImageRef) imageForPageIndex:(NSUInteger)pageIndex {
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGContextRef context = CGBitmapContextCreate(NULL,
pageSize.width,
pageSize.height,
8, /* bits per component_/
pageSize.width * 4, /_ bytes per row */
colorSpace,
kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big);
CGColorSpaceRelease(colorSpace);
if (context == nil) {
//NSLog(@"Failed to create context for pageIndex=%d", pageIndex);
return nil;
}
CGContextClipToRect(context, CGRectMake(0, 0, pageSize.width, pageSize.height));
[dataSource renderPageAtIndex:pageIndex inContext:context];
CGImageRef image = CGBitmapContextCreateImage(context);
CGContextRelease(context);
// REMOVED THE FOLLOWING TWO LINES
// [UIImage imageWithCGImage:image]; // ?? serves no purpose
// CGImageRelease(image); // releases image then passes it back to caller
return image;
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.