After I created the Objective-c class in my project based on the JosephH example . I imported it into my header file. I really managed to get it working using the .pdf file in the main bundle
NSString *file = [[NSBundle mainBundle] pathForResource:@"hello-world" ofType:@"pdf"]; .
which returns:
"/Var/containers/Stack/Application/63F34E6B-75A7-4CC0-9149-9DF2861DF3A2/sempre-editora.app/Hello-world.pdf"
He did everything right, scaling everything. but when I try to display the file in the Documents folder, it just doesn't work. I even tried just putting this "hello-world.pdf" file in my "Documents" to try, and it still doesn't work. This is the path to my docs file:
"/ Var / mobile / Containers / data / Application / AF776E50-FAAC-4274-824F-4F9634E072F6 / Documents / 70-10"
What could be the problem? I am sure that this is the right path for my file, and it actually exists, the framework does not cause any errors, but I just get a gray background.
I thought it could be because my file does not have an extension, but when I add a PDF file to my file and try to display it, it fails.

After some tests, I realized that when a PDF file has two pages, and I go to the second page, it actually displays the PDF file.
source share