pdf-edit — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited pdf-edit (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Use PyMuPDF (fitz) for all PDF operations. It handles both editing and content extraction in a single library.
PyMuPDF loads automatically via uv run --with pymupdf:
uv run --with pymupdf python -c "import fitz; print(fitz.version)"All snippets assume import fitz and use raw strings (r"...") for Windows paths.
uv run --with pymupdf python -c "
import fitz
dst = fitz.open()
for path in [r'dir\file1.pdf', r'dir\file2.pdf']:
src = fitz.open(path)
dst.insert_pdf(src)
src.close()
dst.save(r'dir\output.pdf', garbage=4, deflate=True)
dst.close()
print('Merged')
"uv run --with pymupdf python -c "
import fitz
src = fitz.open(r'dir\input.pdf')
dst = fitz.open()
dst.insert_pdf(src, from_page=0, to_page=0) # first page only
dst.save(r'dir\page1.pdf')
dst.close()
src.close()
print('Split')
"uv run --with pymupdf python -c "
import fitz
doc = fitz.open(r'dir\input.pdf')
for i, page in enumerate(doc):
text = page.get_text('text') # 'text', 'blocks', 'html', 'dict', 'json'
print(f'--- Page {i+1} ---')
print(text)
doc.close()
"uv run --with pymupdf python -c "
import fitz, os
doc = fitz.open(r'dir\input.pdf')
for i, page in enumerate(doc):
for j, img in enumerate(page.get_images()):
xref = img[0]
pix = fitz.Pixmap(doc, xref)
if pix.n - pix.alpha < 4:
pix.save(rf'dir\page{i+1}_img{j+1}.png')
else:
pix1 = fitz.Pixmap(fitz.csRGB, pix)
pix1.save(rf'dir\page{i+1}_img{j+1}.png')
print(f'Page {i+1}, image {j+1}: saved')
doc.close()
"uv run --with pymupdf python -c "
import fitz
doc = fitz.open(r'dir\input.pdf')
for page in doc:
page.set_rotation(90) # 0, 90, 180, 270
doc.save(r'dir\rotated.pdf', garbage=4, deflate=True)
doc.close()
print('Rotated')
"uv run --with pymupdf python -c "
import fitz
doc = fitz.open(r'dir\input.pdf')
doc.save(r'dir\encrypted.pdf',
encryption=fitz.PDF_ENCRYPT_AES_256,
user_pw='user123',
owner_pw='owner456')
doc.close()
print('Encrypted')
"uv run --with pymupdf python -c "
import fitz
doc = fitz.open(r'dir\encrypted.pdf')
if doc.is_encrypted:
doc.authenticate('user123')
print('Pages:', doc.page_count)
doc.close()
"uv run --with pymupdf python -c "
import fitz
doc = fitz.open(r'dir\input.pdf')
page = doc[0]
pix = page.get_pixmap(dpi=150) # default 72
pix.save(r'dir\page1.png')
doc.close()
print('Saved as image')
"uv run --with pymupdf python -c "
import fitz
doc = fitz.open(r'dir\input.pdf')
doc.save(r'dir\optimized.pdf',
garbage=4, # remove unused objects
deflate=True, # compress streams
clean=True) # clean up structure
doc.close()
print('Optimized')
"uv run --with pymupdf python -c "
import fitz
doc = fitz.open(r'dir\input.pdf')
for page in doc:
r = page.rect
page.insert_text(
(r.width/2 - 50, r.height/2),
'WATERMARK',
fontsize=48,
color=(0.5, 0.5, 0.5),
overlay=False)
doc.save(r'dir\watermarked.pdf')
doc.close()
print('Watermarked')
"uv run --with pymupdf python -c "
import fitz
doc = fitz.open(r'dir\input.pdf')
print('Pages:', doc.page_count)
print('Metadata:', doc.metadata)
print('Table of Contents:', doc.get_toc())
for page in doc:
print(f'Page {page.number + 1}: {page.rect.width:.0f}x{page.rect.height:.0f}')
doc.close()
"uv run --with pymupdf python -c "
import fitz
doc = fitz.open(r'dir\input.pdf')
# Delete page 2 (0-indexed)
doc.delete_page(1)
# Move page 1 to after page 3
doc.move_page(0, 2)
doc.save(r'dir\reordered.pdf')
doc.close()
print('Reordered')
"r"C:\path\file.pdf") or escape backslashes ("C:\\path\\file.pdf")doc.is_encrypted before reading; call doc.authenticate(password) to unlockdoc.close() to release file handles, especially in loopsinsert_pdf copies pages from another PDF document object; first open each source with fitz.open()save(garbage=4, deflate=True) to keep file size manageableuv run --with pypdf python ... with the same pattern — pypdf.PdfWriter for merging, pypdf.PdfReader for readinguv run --with pymupdf; no manual pip install needed~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.