2017-07-26 81 views
0

我通常不會在Adobe中編寫腳本,並且在做了一些搜索之後,兔子洞很深,所以我想知道是否有人知道如何將水印添加到通過從Windows批處理文件調用Adobe Acrobat Pro來存在PDF。我已經知道Adobe和Javascript中的'Actions',但不知道如何從批處理文件中調用其中的一個。我可以在這裏接受建議/想法,但如果它達到同樣的效果並且非常簡單 - 即使不使用Adobe使用adobe acrobat pro從windows批處理中爲現有PDF添加水印

回答

1

我不知道你到底想要什麼,但在這裏很短的VBS例如,它可以很容易改變到Windows批處理文件祝你好運,萊因哈德

file = "d:\Test.pdf" 

'// open acrobat and set required objects 
Set App = CreateObject("Acroexch.app") 
app.show 
Set AVDoc = CreateObject("AcroExch.AVDoc") 
Set AForm = CreateObject("AFormAut.App") 'from AFormAPI 

'// open the file and add a watermark based on text (using AcroJs) 
If AVDoc.Open(file,"") Then 
    AForm.Fields.ExecuteThisJavaScript "this.addWatermarkFromText(""Confidential"", 0, font.Helv, 24, color.red);" 
end if 

Set AVDoc = Nothing 
Set AForm = Nothing 
Set APP = Nothing 
+0

冷卻此。可能是我正在尋找的東西(我無法找到從VB.net執行java腳本的擴展方法),我還發現了一個名爲AddWatermarkFromText的GPDDoc.GetJSObject的擴展,我將嘗試。 – user3496060

相關問題