První nahrdánícd

This commit is contained in:
2025-03-16 07:53:00 +01:00
commit 8712668ad4
23 changed files with 735 additions and 0 deletions

22
PDFOpenView.py Normal file
View File

@@ -0,0 +1,22 @@
from pikepdf import Pdf, Name
inputpdf=r"u:\Dropbox\!!!Days\Downloads Z230\Dokumentace\a.pdf"
# # Open the PDF file
# with Pdf.open(inputpdf) as pdf:
# # Ensure the PDF has a Catalog dictionary
# if '/Catalog' not in pdf.Root:
# pdf.Root['/Catalog'] = {}
#
# # Set the OpenAction to fit the page
# pdf.Root['/Catalog']['/OpenAction'] = [pdf.pages[0], Name.Fit]
#
# # Save the modified PDF
# pdf.save('output.pdf')
from pikepdf import Pdf, Dictionary, Name
pdf = Pdf.open(inputpdf)
pdf.Root.PageLayout = Name('/SinglePage')
pdf.Root.PageMode = Name('/UseNone')
pdf.save('output.pdf')