Skip to main content

Generate pdf files from other format documents.

Project description

DocMaker Web UI

DocMaker Web UI is for converting various document formats to PDF format. Generate PDF documents from files such as Markdown, HTML, and CSS by combining them.

Key Features

  • Generate PDFs by combining Markdown, HTML, and CSS.
  • Add custom headers and footers.
  • User-friendly Gradio web interface.

Installation

Prerequisites

Install via pip

pip install docmake

Manual Installation

git clone https://github.com/morisono/docmaker_webui.git docmake
cd docmake
pip install -r requirements.txt

CLI Usage

usage: 
    [Examples]
        - Generate a PDF:
            docmake -i in_*.[html|pdf] -o out.pdf [options]

            For example:
                docmake -i in_*.html -o out.pdf --scale 0.8 --css ' h1 { color: red }'

        - Encrypt/Decrypto a PDF:
            docmake -i in.[html|pdf] -o out.pdf [options]

            For example:
                docmake -i demo.pdf -o demo.encrypted.pdf --encrypto --autogen
                docmake -i demo.encrypted.pdf -o demo.decrypted.pdf --decrypto

         - Read remote file:
            docmake -i $gist --config config.yaml --verbose --qr 40

    [Units]
        You can use the following units for width, height, and margin options:
        - px (pixels) - Default unit., in (inches)., cm (centimeters)., mm (millimeters).

    [Formats]
        The following paper formats are available for the format option:
        - Letter, Legal, Tabloid, Ledger, A0, A1, A2, A3, A4 (default), A5

    [PDF Metadata]
        Metadata format: "/Key Value" pairs separated by space.
        - /Title, /Author, /Subject, /Author, /Keyword, /Creator, /Producer, /CreateDate,  /ModDate, /Trapped
    

Generate PDF from HTML pages.

options:
  -h, --help            show this help message and exit
  -i INPUT [INPUT ...], --input INPUT [INPUT ...]
                        Input files.
  -o OUTPUT, --output OUTPUT
                        Output file path.
  --scale SCALE         Scale of the printed page | 0.8 for 80 percent.
  --displayHeaderFooter
                        Display header and footer.
  --headerTemplate HEADERTEMPLATE
                        Add header template as [url|path|content].
  --footerTemplate FOOTERTEMPLATE
                        Add footer template as [url|path|content].
  --printBackground     Print background images.
  --landscape           Use landscape paper orientation.
  --pageRanges PAGERANGES
                        Page ranges to print | '1-5,8,11-13'.
  --format FORMAT       Paper format | 'A4'.
  --width WIDTH         Paper width | '10cm'.
  --height HEIGHT       Paper height | '10mm'.
  --margin MARGIN       Margin values (e.g., 'top 10mm right 10mm')
  --css CSS             Add css as [url|path|content]
  --config CONFIG       Path to the config file.
  --emulateMedia {screen,print}
                        Type of emulate media.
  --metadata METADATA   Add metadata in the format '/Key: Value'. Example: '/Title Document'.
  --verbose             Print parameters when verbose.
  --encrypto            Encrypt a PDF file.
  --autogen             Automatically generate password for encryption.
  --decrypto            Decrypt a PDF file.
  --regen               Regenerate and send recovery key for decryption.
  --webui               [WIP] Launch Gradio web UI.

Web UI Usage

This section provides instructions on how to use the web user interface (Web UI) of DocMaker Web UI.

  1. Start the app in the project directory:

    docmake --webui
    
  2. Access it in your web browser at http://127.0.0.1:7860.

  3. Use the web interface to configure input files and options.

  4. Click the "▶" button to generate a PDF.

License

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

Support

For inquiries regarding support, including questions and bug reports, please use GitHub Issues.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docmake-0.1.6.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

docmake-0.1.6-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file docmake-0.1.6.tar.gz.

File metadata

  • Download URL: docmake-0.1.6.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.14 Linux/5.15.146.1-microsoft-standard-WSL2

File hashes

Hashes for docmake-0.1.6.tar.gz
Algorithm Hash digest
SHA256 606539034b915e81e0a6acbd28e8e464114467b4b8b66f20ee31a6f27df45101
MD5 e57257409cf10086fa90066ab6f2958e
BLAKE2b-256 619d24a0a820e1fb35b35e16f1f40abb44ec6a624fdfe3a8faccc90d0b36f6af

See more details on using hashes here.

File details

Details for the file docmake-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: docmake-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.14 Linux/5.15.146.1-microsoft-standard-WSL2

File hashes

Hashes for docmake-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 85a39be344f3a7d522e8535af9f60e60b398787f85b1ca4080fbc97dfe69c347
MD5 682ba18e50347f457b73947285c83c13
BLAKE2b-256 31413c7c334bfbecfc0308c721b5b41e472853e2820f2ee1ab37989936cfcae9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page