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

22
Trash/PDFmanipulation.py Normal file
View File

@@ -0,0 +1,22 @@
import os
def set_single_page_view (filepdfin):
from pikepdf import Pdf, Dictionary, Name
import os
from pathlib import Path
pdf=Pdf.open(filepdfin,allow_overwriting_input=True)
# file_only_path=os.path.dirname(filepdfin)
# file_without_ext = Path(filepdfin).stem
pdf.Root.PageLayout=Name('/SinglePage')
pdf.Root.PageMode=Name('/UseNone')
pdf.save()
# set_single_page_view(r"u:\Dropbox\!!!Days\Downloads Z230\Dokumentace\a.pdf")
cesta=r"u:\NextCloudOrdinace\Dokumentace_ke_zpracování"
for file in os.listdir(cesta):
if file.upper().endswith((".PDF")) and os.path.isfile(os.path.join(cesta,file)):
set_single_page_view(os.path.join(cesta,file))