První nahrdánícd
This commit is contained in:
22
PDFOpenView.py
Normal file
22
PDFOpenView.py
Normal 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')
|
||||
Reference in New Issue
Block a user