notebook vb

This commit is contained in:
2026-03-14 07:45:53 +01:00
parent d6cb2b4490
commit a599b6741b
38 changed files with 15 additions and 17 deletions

24
Trash/tagpdf.py Normal file
View File

@@ -0,0 +1,24 @@
from pypdf import PdfReader, PdfWriter
# Load the existing PDF
reader = PdfReader(r"u:\Dropbox\!!!Days\Downloads Z230\output11.pdf")
writer = PdfWriter()
# Copy all pages to the writer
for page in reader.pages:
writer.add_page(page)
#Get metadata
metadata = reader.metadata
author = metadata.get("/Author","")
author=author+', YourName'
print(author)
# Set metadata
writer.add_metadata({"/Author": ""})
writer.add_metadata({"/Author": author})
# Save the updated PDF
with open(r"u:\Dropbox\!!!Days\Downloads Z230\output11.pdf", "wb") as f:
writer.write(f)