Comments (15)
If you just want a specific page there are the first_page
and last_page
parameters. As for the output_folder, you really want to use a tempfile.NamedDirectory
to ensure that the files get cleaned up afterwards.
from pdf2image.
From the top of my head, at that size, you want to make sure that your are using an output_folder and that your format is not ppm.
I'll make a test case on my side as I have never tested more than 500 pages.
from pdf2image.
Just tested with a 2368 pages PDF. If you allow for enough open file handle it does not seem to cause any issue on Ubuntu Server 18.04.
from pdf2image.
please may i know, what change i should make in my linux system to allow enough file handle?
from pdf2image.
On my system, I was able to simply ulimit -n 70000
to make it work.
You might want to make sure that this will persist between reboots.
from pdf2image.
I made it to 70000 as you said...still no chance . Can you try with this one
https://drive.google.com/file/d/13Srl0JfQ-ZCKGnf95ZxFu0JdeH2P9igx/view?usp=sharing
from pdf2image.
I'm getting this issue even with a PDF with less than 200 pages (less than 500 KiB).
@Belval is it possible to return the list of images as a generator instead (if that would solve this issue)?
Basically, I just want the image of one page and convert_from_path(path)[0]
is freezing my computer.
Edit: Tried the output_folder="/tmp"
and fmt="jpg"
parameter as suggested above and now my computer doesn't freeze. That's okay. But I need to manage all the unnecessary files generated. It would have been great if that was handled by pdf2image
itself. π
from pdf2image.
As for why the generated images are not handled by pdf2image, that's because of how Pillow handles images. You see, when you do Image.open()
, the image is just lazy-loaded until you actually use it. If pdf2image cleaned the temp directory, the image converted would become unusable.
from pdf2image.
Ah, I see. No problem. I used tempfile.TemporaryDirectory
as you suggested and it's working fine. π π
Just out of curiosity, would it be possible to return a generator instead of all pages at once?
from pdf2image.
Unfortunately no, as pdftoppm returns all pages at once and this is just a thin wrapper with added multithreading.
from pdf2image.
I am unable to open the pdf with 2nd password.
from pdf2image.
I just try to convert a pdf file less than 50 pages to jpg, there are no jpg files output also, but png. what should i do
from pdf2image.
By the way, pdf2image's version is 1.6, and what version of poppler is better?
from pdf2image.
This issue is now pretty old and a lot have changed since it was originally opened. Feel free to open another issue if you still have issues with PDFs that have a lot of pages.
from pdf2image.
anyone managed to solve the issue with large pdfs with a lot of pages?
i am trying to loop each page so generator would be a good solution.
anyone figured it out?
from pdf2image.
Related Issues (20)
- pdf2image poppler error in Linux HOT 1
- convert_from_bytes has wrong argument name or docstring
- Missing characters like "Ε Δ ΔΎ δ»" when converting a fillable pdf form to image HOT 6
- Missing py.typed file HOT 4
- Wrong image converted HOT 2
- No source release on pypi for 1.16.3 HOT 1
- Inconsistent results between servers with the same code and PDF file HOT 2
- Problem converting from Image coordinates to PDF coordinates
- Invalid SOS parameters for sequential JPEG
- Adding conda poppler to PATH HOT 1
- Lossless conversion HOT 3
- weird CMYK and text at top of output image
- Missing optional arguments in pdfinfo_from_bytes and pdfinfo_from_path HOT 2
- `Page rot` metadata and `size` param interact incorrectly in convert_from_path() HOT 5
- When a pdf is converted to a picture, it takes up a very small part of the picture
- Add an option to start counter generator at index 0 HOT 1
- FileNotFoundError with poppler_path HOT 1
- Is there way to control rotation?
- Some missing words from converting PDF to Image
- OSS-Fuzz Integration HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdf2image.