See also These awesome answers by Ocaso Protal. > 29 page_count = _page_count(pdf_path, userpw)ģ1 if thread_count 165 raise Exception('Unable to get page count. The pdfinfo technique in Ocaso's answer below is also very fast-the same as the pdftoppm one. ~/.conda/envs/dc/lib/python3.5/site-packages/pdf2image/pdf2image.py in convert_from_path(pdf_path, dpi, output_folder, first_page, last_page, fmt, thread_count, userpw) > 1 images = convert_from_path('/home/dianad/testing/UDC-000280.pdf', output_folder='/home/dianad/testing', first_page=1, last_page=1, fmt='jpg') Share Improve this answer Follow answered at 17:24 johnwhitington 2,019 1 15 17 It also prints 'For non-commercial use only' on the output, which is quite annoying, even if you only want the number of pages. Monday night football ad 2012, Cern meyrin switzerland, Dhagpo kagyu ling. > 163 return int(re.search(r'Pages:\s+(\d+)', out.decode("utf8", "ignore")).group(1))ĪttributeError: 'NoneType' object has no attribute 'group'ĭuring handling of the above exception, another exception occurred:Įxception Traceback (most recent call last) cpdf.exe -pages file.pdf which will print the number of pages to standard output. I didnt find a way to extract odt file info as pdfinfo does, but you can create a fast script to use pdfinfo with the odt files, converting each odt file to PDF and later deleting the converted file if you are not going to use it: libreoffice -headless -invisible -convert-to pdf sample.odt pdfinfo sample.pdf grep Pages: rm sample. Lamar dodd faculty, Pdf info command line, Ghost sweeper mikami episode 07. ~/.conda/envs/dc/lib/python3.5/site-packages/pdf2image/pdf2image.py in _page_count(pdf_path, userpw)ġ62 # This will throw if we are unable to get page count as for example the openAIRE program operated by CERN (Shift scholarly communication towards openness and transparency and facilitate innovative ways. ROOT provides with the RooFit library a toolkit for modeling the expected distribution of events in a physics analysis. In : from pdf2image import * In : images = convert_from_path('/home/dianad/testing/UDC-000280.pdf', output_folder='/home/dianad/testing', first_page=1,ĪttributeError Traceback (most recent call last) F - PdfInfo information ( This line will appear ONLY if PdfInfo dened. I installed poppler, but I'm still getting an error.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |