From 1e8ca491f8e4cd5e37e3378b10637e749faf79b1 Mon Sep 17 00:00:00 2001 From: Rongxin Date: Thu, 19 Dec 2024 14:43:42 +0800 Subject: [PATCH] feat (cli): add support for non-pdf/a document; style fixed --- pdf2zh/high_level.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pdf2zh/high_level.py b/pdf2zh/high_level.py index 6965a80e..c60bb266 100644 --- a/pdf2zh/high_level.py +++ b/pdf2zh/high_level.py @@ -254,8 +254,7 @@ def convert_to_pdfa(input_path, output_path): Args: input_path: Path to source PDF file output_path: Path to save PDF/A file - """ - import pikepdf + """pikepdf from pikepdf import Dictionary, Name, Pdf # Open the PDF file @@ -347,7 +346,7 @@ def translate( filename = os.path.splitext(os.path.basename(file))[0] # If the commandline has specified converting to PDF/A format - ## --compatible / -cp + # --compatible / -cp if compatible: file_pdfa = file.replace(".pdf", "-pdfa.pdf") print(f"Converting {file} to PDF/A format...")