A tool for compiling reports from various sources.
Project description
Report Compiler
A powerful automated tool for engineering teams to create professional PDF reports by embedding PDF content directly into Word documents. Write your reports in Word, add simple placeholders for external PDFs, and compile everything into a polished final report with a single command.
What It Does
Transform your Word documents into comprehensive PDF reports by:
- Adding PDF placeholders in your Word document using simple tags
- Automatically inserting external PDF content (drawings, calculations, appendices)
- Precisely positioning PDF overlays within tables or merging full pages
- Compiling everything into a single professional PDF report
Perfect for engineering reports, technical documentation, and any workflow where you need to combine Word content with external PDF files.
Quick Example
-
Write your report in Word with placeholders:
This is my engineering report. [[INSERT: calculations/load_analysis.pdf:1-3]] The table below shows the design sketch: ┌─────────────────────────────────────┐ │ [[OVERLAY: drawings/sketch.pdf]] │ └─────────────────────────────────────┘ Here's the company logo: ┌─────────────────────────────────────┐ │ [[IMAGE: assets/logo.png]] │ └─────────────────────────────────────┘
-
Run the compiler:
report-compiler report.docx final_report.pdf
-
Get a professional PDF with all content seamlessly integrated!
Installation
Option 1: Using uvx (Recommended)
The easiest way to install and run Report Compiler is with uvx:
# Install uv if not already installed. Required version of python will be installed automatically by uv.
winget install --id=astral-sh.uv -e
# Install and run directly (no permanent installation)
uvx report-compiler@latest compile report.docx output.pdf
# Or install globally for repeated use
uvx install report-compiler
report-compiler compile report.docx output.pdf
Option 2: Traditional Installation
# Install from PyPI
pip install report-compiler
# Or install from source
git clone https://github.com/your-repo/report-compiler.git
cd report-compiler
pip install -e .
Word Integration (Optional)
For enhanced productivity, install the Word add-in that provides buttons to insert placeholders and compile reports:
-
Copy the template file to your Word templates folder:
# Download and copy ReportCompilerTemplate.dotm to: # Windows: %APPDATA%\Microsoft\Word\STARTUP\
-
Restart Word - you'll see new "Report Compiler" ribbon buttons
-
Use the buttons to insert placeholders instead of typing them manually
Requirements
- Windows (for Word automation)
- Microsoft Word installed
- Python 3.7+
Usage
Command Line Interface
Basic Compilation
# Compile a Word document to PDF
report-compiler compile input.docx output.pdf
# Enable debug mode (keeps temporary files)
report-compiler compile input.docx output.pdf --keep-temp
# Verbose logging
report-compiler compile input.docx output.pdf --verbose
PDF to SVG Conversion
# Convert single page
report-compiler svg-import input.pdf output.svg --page 3
# Convert multiple pages
report-compiler svg-import input.pdf output.svg --page 1-5
# Convert all pages
report-compiler svg-import input.pdf output.svg --page all
Using Placeholders in Word
There are two types of placeholders you can use:
1. INSERT Placeholders (Full Page Merging)
Use INSERT placeholders to add complete PDF pages into your document. Place these in standalone paragraphs:
[[INSERT: appendices/structural_analysis.pdf]]
[[INSERT: calculations/load_analysis.pdf:1-5]]
[[INSERT: external/report.pdf:2,4,6]]
Page Selection Options:
[[INSERT: file.pdf]]- All pages[[INSERT: file.pdf:5]]- Page 5 only[[INSERT: file.pdf:1-3]]- Pages 1, 2, and 3[[INSERT: file.pdf:1,3,5]]- Pages 1, 3, and 5[[INSERT: file.pdf:2-]]- Pages 2 to end[[INSERT: file.pdf:1-3,7,9-]]- Combined: pages 1-3, 7, and 9 to end
2. OVERLAY Placeholders (Table-Based Positioning)
Use OVERLAY placeholders to position PDF content precisely within tables. Place these inside single-cell tables:
[[OVERLAY: drawings/sketch.pdf]]
[[OVERLAY: diagrams/detail.pdf, page=2]]
[[OVERLAY: sketches/plan.pdf, page=1-3]]
[[OVERLAY: drawings/full_page.pdf, crop=false]]
Parameters:
page=- Specify which pages to overlay (same format as INSERT)crop=- Control content cropping:crop=true(default): Auto-crop to remove whitespacecrop=false: Use full page dimensions
3. IMAGE Placeholders (Direct Image Insertion)
Use IMAGE placeholders to insert image files directly into Word documents. Place these inside single-cell tables:
[[IMAGE: photos/diagram.png]]
[[IMAGE: charts/graph.jpg, width=3in]]
[[IMAGE: icons/logo.png, width=2in, height=1in]]
Supported formats: PNG, JPG, JPEG, GIF, BMP, TIFF, WEBP
Parameters:
width=- Set image width (e.g.,width=2in,width=100px)height=- Set image height (e.g.,height=1.5in,height=200px)- If no dimensions specified: Auto-fits to table size while maintaining aspect ratio
- If only width or height specified: Maintains aspect ratio
Path Resolution
All paths are resolved relative to your Word document's location:
# If your Word document is in C:\Reports\
[[INSERT: appendices/data.pdf]] → C:\Reports\appendices\data.pdf
[[OVERLAY: ..\shared\drawing.pdf]] → C:\shared\drawing.pdf
[[IMAGE: images/chart.png]] → C:\Reports\images\chart.png
[[INSERT: C:\absolute\path\file.pdf]] → C:\absolute\path\file.pdf
Word Integration Buttons
If you installed the Word template, you'll have these ribbon buttons:
- Insert Appendix - Adds an INSERT placeholder with file browser
- Insert Overlay - Adds an OVERLAY placeholder in a table with options
- PDF to SVG - Converts PDF pages to SVG for direct insertion
- Compile Report - Runs the compiler directly from Word
Example Workflow
- Create your report structure in Word with regular text and formatting
- Add placeholders where you want PDF content:
- Use tables with OVERLAY placeholders for positioned content
- Use paragraphs with INSERT placeholders for full-page appendices
- Save your document (required for relative path resolution)
- Run the compiler from command line or Word button
- Get your final PDF with all content integrated seamlessly
Troubleshooting
Common Issues
"Document must be saved first"
- Save your Word document before compilation to enable relative path resolution
"PDF file not found"
- Check that PDF paths are correct relative to your Word document's location
- Use the Word integration buttons for automatic relative path creation
"Word automation failed"
- Ensure Microsoft Word is installed and can be opened
- Close any open Word documents that might interfere
"Page selection invalid"
- Check page numbers exist in the source PDF
- Use 1-based page numbering (first page = 1)
Debug Mode
Enable debug mode to troubleshoot issues:
report-compiler compile report.docx output.pdf --keep-temp --verbose
This will:
- Keep all temporary files for inspection
- Show detailed processing logs
- Help identify where issues occur
System Requirements
- Windows (for Word automation)
- Microsoft Word installed
- Python 3.7+
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file report_compiler-0.1.12.tar.gz.
File metadata
- Download URL: report_compiler-0.1.12.tar.gz
- Upload date:
- Size: 275.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
864085250399091db694b199e096df4f496c5b06bfd12a390b9adc55f62c2589
|
|
| MD5 |
8509bba5e2dddc16ca8ea9536b5d9953
|
|
| BLAKE2b-256 |
5485ccb88b2e4d3df4b1c460d823e92d7c7c6ccebfbc85b6b334b81273592b1e
|
Provenance
The following attestation bundles were made for report_compiler-0.1.12.tar.gz:
Publisher:
pypi-publish.yml on Mark-Milkis/report-compiler
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
report_compiler-0.1.12.tar.gz -
Subject digest:
864085250399091db694b199e096df4f496c5b06bfd12a390b9adc55f62c2589 - Sigstore transparency entry: 536651176
- Sigstore integration time:
-
Permalink:
Mark-Milkis/report-compiler@a552e0a859601086aa1f60a506b97ed646fc87c8 -
Branch / Tag:
refs/tags/v0.1.12 - Owner: https://github.com/Mark-Milkis
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@a552e0a859601086aa1f60a506b97ed646fc87c8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file report_compiler-0.1.12-py3-none-any.whl.
File metadata
- Download URL: report_compiler-0.1.12-py3-none-any.whl
- Upload date:
- Size: 48.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf3d525466cb474597d455a722d65bc5354087202346037a8cecf500181a9a73
|
|
| MD5 |
812005c26530bbe7a8dba263a54161c8
|
|
| BLAKE2b-256 |
5f7a9c28868ecce47a92b82e6eb0d2d519d33c685c124506fb5536bdb05387f0
|
Provenance
The following attestation bundles were made for report_compiler-0.1.12-py3-none-any.whl:
Publisher:
pypi-publish.yml on Mark-Milkis/report-compiler
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
report_compiler-0.1.12-py3-none-any.whl -
Subject digest:
cf3d525466cb474597d455a722d65bc5354087202346037a8cecf500181a9a73 - Sigstore transparency entry: 536651178
- Sigstore integration time:
-
Permalink:
Mark-Milkis/report-compiler@a552e0a859601086aa1f60a506b97ed646fc87c8 -
Branch / Tag:
refs/tags/v0.1.12 - Owner: https://github.com/Mark-Milkis
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@a552e0a859601086aa1f60a506b97ed646fc87c8 -
Trigger Event:
release
-
Statement type: