Mit dem Skript "AddWatermarkToPDF" erstelle ich Briefe auf unserem Briefpapier. Nun würde ich gerne folgendes erreichen:
- User druckt Word-Dokument auf PDFCreator - PDF ohne Hintergrundbild wird erstellt - PDF mit Hintergrundbild wird zusätzlich erstellt (im gleichen Ordner, mit dem gleichen Dateiname + "_Briefpapier").
Bestimmt kann man das Skript "AddWatermarkToPDF" entsprechend modifizieren, nur leider übersteigt dies meine Kenntnisse... Man müsste ja einfach das neu erstellte PDF mit Watermark unter einem neuen Name speichern. Es wäre super, wenn mir hier jemand kurz helfen könnte!
Gruss & Danke
' AddWatermarkToPDF script ' Part of PDFCreator ' License: GPL ' Homepage: http://www.sf.net/projects/pdfcreator ' Version: 1.1.0.0 ' Date: September, 1. 2005 ' Author: Frank Heindörfer ' Comments: This script needs pdftk. ' For more informations about the freeware pdftk use this link: ' http://www.accesspdf.com
If objArgs.Count = 0 Then MsgBox "This script needs a parameter!", vbExclamation, AppTitle WScript.Quit End If
fname = objArgs(0)
Set fso = CreateObject("Scripting.FileSystemObject")
If Ucase(fso.GetExtensionName(fname)) <> "PDF" Then MsgBox "This script works only with pdf files!", vbExclamation, AppTitle WScript.Quit End If
If Not fso.FileExists(PathToPdftk) Then MsgBox "You need pdftk for this script!" & vbcrlf & vbcrlf & _ "Please go to http://www.accesspdf.com and download it.", vbExclamation, AppTitle WScript.Quit End If
If Not fso.FileExists(WatermarkPDF) Then MsgBox "Can't find the watermark pdf file!", vbExclamation, AppTitle WScript.Quit End If
' AddWatermarkToPDF script ' Part of PDFCreator ' License: GPL ' Homepage: http://www.sf.net/projects/pdfcreator ' Version: 1.1.0.0 ' Date: September, 1. 2005 ' Author: Frank Heindörfer ' Comments: This script needs pdftk. ' For more informations about the freeware pdftk use this link: ' http://www.accesspdf.com
Dim objArgs, fname, tfname, name, laenge, fso, WshShell, oExec
Set objArgs = WScript.Arguments
If objArgs.Count = 0 Then MsgBox "This script needs a parameter!", vbExclamation, AppTitle WScript.Quit End If
fname = objArgs(0)
Set fso = CreateObject("Scripting.FileSystemObject")
If Ucase(fso.GetExtensionName(fname)) <> "PDF" Then MsgBox "This script works only with pdf files!", vbExclamation, AppTitle WScript.Quit End If
If Not fso.FileExists(PathToPdftk) Then MsgBox "You need pdftk for this script!" & vbcrlf & vbcrlf & _ "Please go to http://www.accesspdf.com and download it.", vbExclamation, AppTitle WScript.Quit End If
If Not fso.FileExists(WatermarkPDF) Then MsgBox "Can't find the watermark pdf file!", vbExclamation, AppTitle WScript.Quit End If
laenge = len(fname)-4 name=left(fname,laenge) fso.copyfile fname, name &"_weiss.pdf"
' AddWatermarkToPDF script ' Part of PDFCreator ' License: GPL ' Homepage: http://www.sf.net/projects/pdfcreator ' Version: 1.1.0.0 ' Date: September, 1. 2005 ' Author: Frank Heindörfer ' Comments: This script needs pdftk. ' For more informations about the freeware pdftk use this link: ' http://www.accesspdf.com
Dim objArgs, fname, tfname, name, laenge, fso, WshShell, oExec
Set objArgs = WScript.Arguments
If objArgs.Count = 0 Then MsgBox "This script needs a parameter!", vbExclamation, AppTitle WScript.Quit End If
fname = objArgs(0)
Set fso = CreateObject("Scripting.FileSystemObject")
If Ucase(fso.GetExtensionName(fname)) <> "PDF" Then MsgBox "This script works only with pdf files!", vbExclamation, AppTitle WScript.Quit End If
If Not fso.FileExists(PathToPdftk) Then MsgBox "You need pdftk for this script!" & vbcrlf & vbcrlf & _ "Please go to http://www.accesspdf.com and download it.", vbExclamation, AppTitle WScript.Quit End If
If Not fso.FileExists(WatermarkPDF) Then MsgBox "Can't find the watermark pdf file!", vbExclamation, AppTitle WScript.Quit End If
laenge = len(fname)-4 name=left(fname,laenge) fso.copyfile fname, name &"_weiss.pdf"