banner



How To Install Poppler In Anaconda

Python, PDFs, and Window'south Subsytem for Linux

Poppler On Windows

Intro:

Portable Document Format (PDFs) are everywhere and importing a pop python-package like PDF2Image, PDFtoText, or PopplerQt5 is a mutual approach to dealing with them. Unfortunately, unless you are working with a Linux machine, many users are reporting that these packages are returning errors because they rely on Poppler.

Never heard of Poppler?

Poppler is a utility for rendering PDFs and it'southward common to Linux systems, but not Windows. So, naturally, if you lot want to employ Poppler and its associated packages, we need to bridge the gap.

Let'southward visit google and see what our options are…

A quick Google (StackOverflow) search reveals that in that location are many other people having this problem and they are still looking for solutions.

  • PDF to JPG (Poppler)
  • Install Poppler on Windows?
  • Cannot Install 'PDFtoText' on Windows (Poppler)
  • Running PyPDFOCR on Windows — Requires Poppler?
  • ModuleNotFoundError — No Module Named 'SipDistUtils' (Poppler)

The Problem:

Poppler and Python's PDF-libraries, which leverage Linux-utilities, don't play well with Windows.

When nosotros look for solutions, many of them are outdated, ineffective, too hard, etc…

The Solution:

Of the purposed solutions, one solution appears to piece of work well.

Windows Subsystem for Linux (WSL).

Actually, because of how powerful Windows Subsystem for Linux is, it's a neat solution for other problems which require Linux tools on a Windows auto.

And so, what is WSL?

Windows Subsystem for Linux is a compatibility layer for Linux binary executables natively on Windows x. Information technology recently entered version two (WSL 2) and introduced a real Linux kernel. To put it plain, WSL makes it feel like y'all're working on a real Linux motorcar (and you are).

Installation and Usage Guide — WSL

Reference

In this section, nosotros volition, in five short steps, install and setup WSL. Afterwards, we volition install and setup Poppler in a few short steps.

Step 1:

Run Window'south Powershell as an administrator.

Step ii:

Enable WSL past executing the 'Enable-WindowsOptionalFeature' command:

Enabling WSL

Footstep 3:

Activate the changes by restarting your computer.

Annotation that, Microsoft says, "This reboot is required in society to ensure that WSL tin initiate a trusted execution environment."

Footstep 4:

At present, you're back from a restart, your system's WSL is enabled, and you are ready to install a Linux distribution.

Become to the Window's Store and search for WSL.

Getting WSL from Windows Store

Step 5 (last):

Click Ubuntu and choose to install. Notation, mine is already installed, so you have to do some imagining here.

Installing Ubuntu

Installation and Usage Guide — Poppler:

Step ane:

Enter WSL through a terminal like this one in VS Code. Notice that, in one case you lot enter WSL, the terminal prompt will modify. You lot are now operating inside a Linux machine! Exciting!

Enter WSL

Footstep 2:

Conduct the following commands within the WSL-prompt. Annotation that, you tin can ignore some of the steps that bargain with Tesseract-OCR and PyTesseract. These are for the demo-projection which I share at the end of the article.

Step 3 — Testing (final):

Run a program with your newly acquired, prepare-to-apply, Poppler utilities.

I've created this demo script, then you can utilize information technology if you don't have your ain. Although, yous will demand a PDF to mess with.

This lawmaking works by converting a PDF to JPG. And so, information technology conducts OCR and writes the OCR-results to an output-file.

Conclusion:

That'due south it. You are certified Poppler-On-Windows.

Savor the spoils of war! You have gained some seriously new and powerful skills. You lot are well on your way to becoming a more flexible programmer (if you aren't already).

Newly Caused Skills:

  • Power to successful manipulate PDFs with Python.
  • Access to PDF2Image, PDFToText, or other Poppler-utils.
  • Windows Subsystem for Linux. ** A seriously powerful dev-tool **

At present What… What Can You Build?

It'due south so important to experiment with these new skills and solidify your understanding. Truthful understanding comes with experience.

My Poppler-On-Windows Projection:

I built an OCR awarding to help document the historical work of emeritus professor and famous computer scientist, Dr. Kenneth E. Batcher. It uses a PDF to paradigm tool for JPEG-conversion. And so, it does OCR on the image and writes the results to an output file. Since this proof of concept works well enough, information technology'll somewhen be used on certificate-scans instead of PDFs.

You tin find the project here.

OCR App — In Development

Source: https://towardsdatascience.com/poppler-on-windows-179af0e50150

Posted by: terrellfolody.blogspot.com

0 Response to "How To Install Poppler In Anaconda"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel