Created attachment 10925 [details] pdf file with annotation The page with annotation is OK.but mupdf only shows annotation, the content is missing. It's no problem when debug app on device.The problem happened when the app ran in iOS Simulator or on device in release mode. But when I change Optimization Level of Release Configuration In Xcode Build Settings to None, build, install and run, the problem is disappeared. So I guess some code may be ignored by compiler optimization?
When I try this, I always find that the page content is missing, and only the annotations are displayed, irrespective of what type of build/optimisation I choose. In fact, the problem also happens when I tested on OS X, so I think this is a problem in the core rather than the iOS specific code. Therefore, I'm removing the iOS tag.
This has also been reported as bug 695596 (which contains further analysis).
We display this file exactly as Acrobat does. Thus I believe the bug is not to do with how we display this file, but rather how the file came to be this way. I believe that the file had content until it was annotated by MuPDF, whereupon it was saved back. Due to a bug in MuPDF that had the effect of losing the page contents. bug 695596 was about that specific problem and has been closed as being fixed now. In addition I've stripped off the incremental update from this file giving me the 'before' file, and have added annotations in the current version. This saves without issue. I am therefore closing this bug. Please reopen it with both before and after files if the problem still exists.