-
6 votes
-
[Python] Trouble fetching checkbox and radio fields with PyPDF2
My project involves reading text from a bunch of PDF form files for which I'm using PyPDF2 open source library. There is no issue in getting the text data as follows: reader =...
My project involves reading text from a bunch of PDF form files for which I'm using PyPDF2 open source library. There is no issue in getting the text data as follows:
reader = PdfReader("data/test.pdf") cnt = len(reader.pages) print("reading pdf (%d pages)" % cnt) page = reader.pages[cnt-1] lines = page.extract_text().splitlines() print("%d lines extracted..." % len(lines))However, this text doesn't contain the checked statuses of the radio and checkboxes. I just get normal text (like "Yes No" for example) instead of these values.
I also tried the
reader.get_fields()andreader.get_form_text_fields()methods as described in their documentation but they return empty values. I also tried reading it through annotations but no"/Annots"found on the page. When I open the PDF in anotepad++to see its meta data, this is what I get:%PDF-1.4 %²³´µ %Generated by ExpertPdf v9.2.2It appears to me that these checkboxes aren't usual form fields used in PDF but appear similar to HTML elements. Is there any way to extract these fields using python?
2 votes -
‘Batman: Caped Crusader’ animated series from Bruce Timm, JJ Abrams, Matt Reeves axed at HBO Max, will be shopped elsewhere
7 votes -
Guild Wars 2 Steam launch and tenth anniversary is tomorrow
12 votes -
Best Linux Distro for gaming/noob
Hey y’all. Recently picked up a Cyberpower prebuilt. Looking to install a Linux distro on it for gaming. Currently have Ubuntu on my laptop, so I’m not a total noob, but my experience is still...
Hey y’all. Recently picked up a Cyberpower prebuilt. Looking to install a Linux distro on it for gaming. Currently have Ubuntu on my laptop, so I’m not a total noob, but my experience is still low. Not a big fan of having to use the terminal. Any distros y’all would recommend? Am leaning toward Pop_OS or SteamOS.
7 votes -
Stable Diffusion public release - a fully open text-to-image generator
20 votes -
Why the US Army electrifies this water
7 votes -
Vietnam says homosexuality ‘not a disease’ in win for gay rights
15 votes -
A teen’s journey into the internet’s darkness and back again
5 votes -
MoviePass to relaunch on Labor Day in beta form with pricing ranging from $10-$30 a month
11 votes -
Norway wants Facebook fined for illegal data transfers – European regulators are finalizing a decision blocking Meta from transferring data to the US
6 votes -
Investigating the mysteriously feel-good "Texas Turnaround"
11 votes -
What games have you been playing, and what's your opinion on them?
What have you been playing lately? Discussion about video games and board games are both welcome. Please don't just make a list of titles, give some thoughts about the game(s) as well.
12 votes -
What have you been eating, drinking, and cooking?
What food and drinks have you been enjoying (or not enjoying) recently? Have you cooked or created anything interesting? Tell us about it!
7 votes -
Weekly US politics news and updates thread - week of August 22
This thread is posted weekly - please try to post all relevant US political content in here, such as news, updates, opinion articles, etc. Extremely significant events may warrant a separate...
This thread is posted weekly - please try to post all relevant US political content in here, such as news, updates, opinion articles, etc. Extremely significant events may warrant a separate topic, but almost all should be posted in here.
This is an inherently political thread; please try to avoid antagonistic arguments and bickering matches. Comment threads that devolve into unproductive arguments may be removed so that the overall topic is able to continue.
6 votes -
UK inflation to hit 18.6% next year according to Citi
Archive: https://archive.ph/t0oH2 From the article: UK inflation is on course to hit 18.6 per cent in January — the highest peak in almost half a century — because of soaring wholesale gas prices,...
Archive: https://archive.ph/t0oH2
From the article:
UK inflation is on course to hit 18.6 per cent in January — the highest peak in almost half a century — because of soaring wholesale gas prices, according to a new forecast from Citigroup based on the latest market prices.
The investment bank predicted that the retail energy price cap would be raised to £4,567 in January and then £5,816 in April, compared with the current level of £1,971 a year — shifts it said would lead to inflation “entering the stratosphere”.
[...]
UK and European wholesale natural gas prices are already trading at close to 10 times normal levels and other forecasters have also raised their inflation predictions.
Goldman Sachs and EY said they expected an inflation rate of at least 15 per cent around the start of next year and the Bank of England said this month that inflation would exceed 13 per cent towards the end of the year.
The energy regulator Ofgem will on Friday announce the energy price cap for the period between October and January, which most analysts expect to rise to more than £3,500 for a household with average usage of energy — an increase of 75 per cent on current levels.
12 votes -
New photos of Jupiter by the James Webb Space Telescope
22 votes -
Weekly coronavirus-related chat, questions, and minor updates - week of August 22
This thread is posted weekly, and is intended as a place for more-casual discussion of the coronavirus and questions/updates that may not warrant their own dedicated topics. Tell us about what the...
This thread is posted weekly, and is intended as a place for more-casual discussion of the coronavirus and questions/updates that may not warrant their own dedicated topics. Tell us about what the situation is like where you live!
5 votes -
Once a trading gateway to the world, Finland's ancient capital of Turku is carving out a new niche as a Nordic food hotspot
3 votes -
The nuts and bolts of siting and building power lines
6 votes -
Good conversations have lots of doorknobs
12 votes -
The Last of Us | Teaser trailer
9 votes -
Silent crisis of soaring excess deaths gripping Britain is only tip of the iceberg
6 votes -
Inside the final days of ‘The Wendy Williams Show’
6 votes -
A dad took photos of his naked toddler for the doctor. Google flagged him as a criminal.
14 votes -
Environmental defenders celebrate a ‘huge’ win for ‘unique’ Tasmanian rainforest
6 votes -
Gallery of physical visualizations
5 votes -
Apology for video games research
8 votes -
How many fossils to go an inch? An animated essay
9 votes -
Aleksandr Dugin, prominent Russian far right figure, targeted by car bomb that kills daughter Daria Dugina
16 votes -
How “dementia villages” work
6 votes -
Instead of a field, hundreds of Danish growers now share patches of the ocean, growing mussels, sea kelp and more
6 votes -
Inside the crypto black markets of Argentina
4 votes -
Arizona farmers grew Saudi Arabia's agriculture empire. Now, the monarchy has a chunk of the state's water.
8 votes -
Röyksopp feat. Susanne Sundfør – Oh, Lover (2022)
10 votes -
How I do (and don’t) prepare a talk for a tech conference
4 votes -
How to use Webkit's new CSS4 ":has()" selector
10 votes -
Spotify and EasyJet to use music preferences to suggest holiday destinations
5 votes -
Much ado about nothing – Sanna Marin and a very Finnish scandal
10 votes -
China says Hollywood needs to show respect as films blocked
10 votes -
HBO Max removes about 200 ‘Sesame Street’ episodes
9 votes -
What have you been listening to this week?
What have you been listening to this week? You don't need to do a 6000 word review if you don't want to, but please write something! If you've just picked up some music, please update on that as...
What have you been listening to this week? You don't need to do a 6000 word review if you don't want to, but please write something! If you've just picked up some music, please update on that as well, we'd love to see your hauls :)
Feel free to give recs or discuss anything about each others' listening habits.
You can make a chart if you use last.fm:
http://www.tapmusic.net/lastfm/
Remember that linking directly to your image will update with your future listening, make sure to reupload to somewhere like imgur if you'd like it to remain what you have at the time of posting.
8 votes -
Failure to cope "under capitalism"
14 votes -
A Strange Loop: Tiny Desk (Home) Concert (2022)
3 votes -
How US National Environmental Policy Act works
4 votes -
What did you do this week (and weekend)?
As part of a weekly series, these topics are a place for users to casually discuss the things they did — or didn't do — during their week. Did you accomplish any goals? Suffer a failure? Do...
As part of a weekly series, these topics are a place for users to casually discuss the things they did — or didn't do — during their week. Did you accomplish any goals? Suffer a failure? Do nothing at all? Tell us about it!
6 votes -
D&D 6th Edition announced (but they're calling it One D&D for now)
22 votes -
No show earned its ending more than ‘Better Call Saul’
10 votes -
Embracer Group, parent company for a vast and expanding roster of studios and publishers, goes on a spending spree buying up Middle-earth Enterprises and more
9 votes -
Awesome isochrones
6 votes