Coder Social home page Coder Social logo

eunsirbeen / translate-pdf Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aquacode/translate-pdf

0.0 0.0 0.0 28 KB

Translates text in a PDF file from one language to another

License: MIT License

Python 67.38% Shell 11.98% Batchfile 20.64%

translate-pdf's Introduction

Translate text in PDF file

Python script that uses Google Translate to translate text in a PDF file

Prerequisites:

Note: Only used/tested with Python3

Google Cloud SDK

Google API Client Library for Python

pdftotext as a Python module

How To Use:

  1. Complete the Prerequisites above

  2. Acquire/generate Google API credentials and set them

  3. Execute the main.py script according to the following:

    python3 main.py <PDF_input_file> <target_language> <name_of_output_file>

Expected output:

  • Console (stdout) will print the translated text for each page
  • The named output file will contain all the translated text with a Page number heading correlated to the page found in the PDF file

Sample data:

The /sample directory contains a PDF file that can be used for testing

The file has French text of an Edgar Allen Poe poem titled "The Raven"

translate-pdf's People

Contributors

aquacode avatar eunsirbeen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.