Skip to main content
# persian_pdf_converter

A Python package for converting PDF files to Word documents and modifying URLs. This package utilizes Tesseract OCR for text recognition in PDF files.

## Features

- Convert PDF files to Word documents with text recognition
- Modify URLs based on directory paths

## Requirements

- Python 3.6 or higher
- Tesseract OCR installed and configured

## Installation

To install the package, use pip:

```bash
pip install persian-pdf-converter

Usage

Here is an example of how to use the functions provided by this package:

from persian_pdf_converter.pdf_converter import pdf_to_word

# Path to your PDF file and output directory
pdf_path = 'path/to/example.pdf'
output_dir = 'path/to/output/dir'

# Convert PDF to Word
output_file = pdf_to_word(pdf_path, output_dir, lang="fas+eng", dpi=300)
print(f"Converted file saved as: {output_file}")

pdf_to_word Function

This function converts a PDF file to a Word document with text recognition.

Parameters:

  • pdf_path (str): Path to the PDF file.
  • output_dir (str): Directory where the output Word file will be saved.
  • lang (str): Languages to be used by Tesseract for text recognition (default is "fas+eng").
  • Additional keyword arguments for convert_from_path.

Returns:

  • str: Name of the output Word file.

Development

To contribute to this project, follow these steps:

  1. Clone the repository:
    git clone https://github.com/mahdiramezanii/persian_pdf_converter.git
    
  2. Navigate to the project directory:
    cd persian_pdf_converter
    
  3. Create a virtual environment and activate it:
    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
    
  4. Install the dependencies:
    pip install -r requirements.txt
    
  5. Make your changes and run tests.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Contact

If you have any questions or suggestions, feel free to contact me at mahdiramazanii.official@gmail.com.

Metadata

Release files for persian-pdf-converter 2.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for persian-pdf-converter 2.3.1
File Size Uploaded Provenance Actions
persian_pdf_converter-2.3.1.tar.gz 93.7 MB Without provenance Details for persian_pdf_converter-2.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for persian-pdf-converter 2.3.1
File Interpreter ABI Platform Actions
persian_pdf_converter-2.3.1-py3-none-any.whl Python 3 none any Details for persian_pdf_converter-2.3.1-py3-none-any.whl

Total release size: 187.9 MB

Release files / persian_pdf_converter-2.3.1.tar.gz

Download URL persian_pdf_converter-2.3.1.tar.gz
Size 93.7 MB
Tags Source
SHA-256 checksum
How to use checksums
7cf58b36322ac6cf720f57a2367751f309c5e9618a45f16a85433cb3407a4143
BLAKE2b-256 checksum
How to use checksums
246378a841db0ae43e6f796717fe74cf875352203d96204945c89d3d8a1cc18e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.4

Release files / persian_pdf_converter-2.3.1-py3-none-any.whl

Download URL persian_pdf_converter-2.3.1-py3-none-any.whl
Size 94.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
335f74d4eb34c328bfbba782dde21ec699aae7bf3a73c07416b129561acaaaa6
BLAKE2b-256 checksum
How to use checksums
944f8119806c5fe987853e821926f37424df783a2c17dd971dbbbb42aa490f02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.4

Security for persian-pdf-converter 2.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.3.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page