Skip to content

Commit b73a83a

Browse files
authored
feat: Support unlock pymupdf (#49)
1 parent 67a2850 commit b73a83a

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

lightblue_ai/tools/document/pdf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
from pathlib import Path
23
from typing import Annotated, Any
34

@@ -82,6 +83,11 @@ def __init__(self):
8283
"This tool will also convert the PDF to images and save them in the `image_path` directory. "
8384
"You can View the images using the `view` tool. "
8485
)
86+
if pymupdf_pro_password := os.getenv("PYMUPDF_PRO_PASSWORD"):
87+
import pymupdf.pro
88+
89+
pymupdf.pro.unlock(pymupdf_pro_password)
90+
self.description += "\n **This tool now supports DOC/DOCX, XLS/XLSX, PPT/PPTX, HWP/HWPX as PRO version.**"
8591

8692
async def call(
8793
self,

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ dependencies = [
3232
"pydantic-ai>=0.2.0",
3333
"pydantic-settings>=2.8.1",
3434
"pymupdf4llm>=0.0.21",
35+
"pymupdfpro>=1.25.5",
3536
"python-dotenv>=1.1.0",
3637
"rich>=14.0.0",
3738
"tavily-python>=0.5.3",

uv.lock

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)