浏览代码

PDF-Briefkopf

Global Cube 2 年之前
父节点
当前提交
d5a1014226
共有 4 个文件被更改,包括 44 次插入4 次删除
  1. 二进制
      tools/pdf/dist/pdf_watermark.exe
  2. 3 0
      tools/pdf/pdf_watermark.bat
  3. 1 4
      tools/pdf/pdf_watermark.py
  4. 40 0
      tools/pdf/pdf_watermark.spec

二进制
tools/pdf/dist/pdf_watermark.exe


+ 3 - 0
tools/pdf/pdf_watermark.bat

@@ -0,0 +1,3 @@
+cd /d %~dp0
+pyinstaller -F --path %~dp0 pdf_watermark.py
+pause

+ 1 - 4
tools/pdf/pdf_watermark.py

@@ -1,13 +1,10 @@
 import PyPDF2
-import os
 import plac
 from pathlib import Path
 
 
-watermark_file = os.path.dirname(__file__) + '/template/Briefbogen_GC_Jahnstr_GmbH.pdf'
-
-
 def add_watermark(input_file):
+    watermark_file = 'c:/tools/template/Briefbogen_GC_Jahnstr_GmbH.pdf'
     output_file = Path(input_file).parent.joinpath("mit_Briefpapier", Path(input_file).name)
     if not output_file.parent.exists():
         output_file.parent.mkdir()

+ 40 - 0
tools/pdf/pdf_watermark.spec

@@ -0,0 +1,40 @@
+# -*- mode: python ; coding: utf-8 -*-
+
+
+block_cipher = None
+
+
+a = Analysis(['pdf_watermark.py'],
+             pathex=['C:\\Projekte\\Python\\tools\\pdf\\'],
+             binaries=[],
+             datas=[],
+             hiddenimports=[],
+             hookspath=[],
+             hooksconfig={},
+             runtime_hooks=[],
+             excludes=[],
+             win_no_prefer_redirects=False,
+             win_private_assemblies=False,
+             cipher=block_cipher,
+             noarchive=False)
+pyz = PYZ(a.pure, a.zipped_data,
+             cipher=block_cipher)
+
+exe = EXE(pyz,
+          a.scripts,
+          a.binaries,
+          a.zipfiles,
+          a.datas,  
+          [],
+          name='pdf_watermark',
+          debug=False,
+          bootloader_ignore_signals=False,
+          strip=False,
+          upx=True,
+          upx_exclude=[],
+          runtime_tmpdir=None,
+          console=True,
+          disable_windowed_traceback=False,
+          target_arch=None,
+          codesign_identity=None,
+          entitlements_file=None )