Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App Terminated due to memory issue #88

Open
najoua opened this issue Apr 12, 2018 · 1 comment
Open

App Terminated due to memory issue #88

najoua opened this issue Apr 12, 2018 · 1 comment

Comments

@najoua
Copy link

najoua commented Apr 12, 2018

Hi,

I am using your library, thank you so much for this. But actually i'am facing a problem, I am using big Pdf files with important resolution, and unfortunatelythe app crashes because of that. Could you help me solving the problem please, it's very urgent.

NB: I tried to decrease the resolution and it works much better with some file, but it's not a good solution, because i don't know when the app may stop.

Thank you for help

@fulviomoya
Copy link

fulviomoya commented May 13, 2018

Hi,
I have the same problem using documents of ~220MB, because the PDF files we've tried to open has high resolutions and the library cannot allocate and deallocate the memory too fast causing will crash the app.

Try this temporal solution:

  1. Create PDFViewController using the parameter isThumbnailsEnabled equal to false.
    PDFViewController.createNew(with: pdfDocument, title: fileName, isThumbnailsEnabled: false).

  2. Remove / comment the function loadPages on PDFDocument.swift which

Extracts image representations of each page in a background thread and stores them in the cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants