Skip to content

retailzipline/pydocx-resize-images

 
 

Repository files navigation

pydocx-resize-images

Overview

An mixin for PyDocX that resize all the images when converting from .docx to .html

Requirements

  • Python 3.9.18
  • Works on Linux, Windows, Mac OSX, BSD

Install

The quick way:

pip install pydocxresizeimages

Usage

Here is an example of mixin usage:

from pydocx.export import PyDocXHTMLExporter
from pydocxresizeimages import ResizedImagesExportMixin

class PyDocXHTMLExporterWithResizedImages(ResizedImagesExportMixin, PyDocXHTMLExporter):
    pass

docx_path = 'path/to/file/doc.docx'
exporter = PyDocXHTMLExporterWithResizedImages(docx_path)

html = exporter.export()

Running Tests ============

Ensure you have have prerequisites:

pyenv:

brew install pyenv

python runtimes:

pyenv install 3.9.18

install and run tox:

pyenv local 3.9.18
pip install tox tox-pyenv
tox

Note that 'doctest' is only used in 'pydocxresizeimages/util/uri.py'

About

A plugin for PyDocX that resizes images before exporting them to HTML

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 96.9%
  • Makefile 3.1%