我使用仅适用于Mozilla Firefox的Web应用程序。操作网页以包含水印
一个特定的任务生成一个页面来打印要邮寄的信件。
打印完信后,我的同事应该为邮局的品牌加盖邮票,并手工写出邮件的发送日期。
有没有什么办法可以在打印之前操纵页面的显示以在HTML中包含一个带有图章图像的行?
任何想法?
非常感谢。
我使用仅适用于Mozilla Firefox的Web应用程序。操作网页以包含水印
一个特定的任务生成一个页面来打印要邮寄的信件。
打印完信后,我的同事应该为邮局的品牌加盖邮票,并手工写出邮件的发送日期。
有没有什么办法可以在打印之前操纵页面的显示以在HTML中包含一个带有图章图像的行?
任何想法?
非常感谢。
是否有任何理由需要通过autohotkey完成?如果您有权访问代码,则可以添加覆盖图章图像的打印样式表。
SmashingMagazine有a fantastic guide to print stylesheets:
从本质上讲,所有你需要做的就是添加到您现有的样式表:
@media print {
//css to add the stamp image overlay here
}
感谢您的反馈意见。
我想通了。
这是我的代码:
#NoEnv
#Persistent
#SingleInstance force
SendMode Input
SetWorkingDir %A_ScriptDir%
Gui, Add, Button, gCorreios, Correios
Gui, Show
Return
Correios:
Sleep 100
Send, {ALT DOWN}{ESC}{ALT UP}
Send, {CTRLDOWN}f{CTRLUP}
Sleep 10
Send, Postado{ESC}
Sleep 10
Send, {SHIFTDOWN}{END}{SHIFTUP}{CTRLDOWN}c{CTRLUP}
ClipWait
Sleep 10
DataDaPostagem=%Clipboard%
ClipBoard =
Sleep 10
StringReplace, DataDaPostagem, DataDaPostagem, postado,, All
StringReplace, DataDaPostagem, DataDaPostagem, em,, All
StringReplace, DataDaPostagem, DataDaPostagem, :,, All
StringReplace, DataDaPostagem, DataDaPostagem, `,,, All
StringReplace, DataDaPostagem, DataDaPostagem, %A_SPACE%,, All
Sleep 10
Send, {SHIFT DOWN}{F4}{SHIFT UP}
WinWait, Scratchpad,
IfWinNotActive, Scratchpad, , WinActivate, Scratchpad,
WinWaitActive, Scratchpad,
Send, {CTRLDOWN}a{CTRLUP}{DEL}
Send, var correios=document.createElement("div");{ENTER}
Send, correios.id="correios";{ENTER}
Send, correios.style="background:url(http://i62.tinypic.com/169hxls.png) no-repeat; display:block; height:37px; padding:135px 0 0 0; position:absolute; right:0; text-align:center; top:0; width:171px; z-index:-1";{ENTER}
Send, correios.innerHTML="
Send, %DataDaPostagem%
Send, ";{ENTER}
Send, document.getElementsByTagName("body")[0].appendChild(correios);{ENTER}
Send, {CTRLDOWN}r{CTRLUP}
Sleep 10
Send, {CTRLDOWN}w{CTRLUP}
WinWait, Alterações não salvas,
IfWinNotActive, Alterações não salvas, , WinActivate, Alterações não salvas,
WinWaitActive, Alterações não salvas,
Send, d
Sleep 10
return
~^s::
IfWinActive, %A_ScriptName%
{
SplashTextOn,,,Updated script,
Sleep, 200
SplashTextOff
Reload
}
return
的AutoHotkey不会是实现这一目标的一个非常有效的方式,考虑做一个自定义的Greasemonkey脚本。 –
不能修改“生成页面以打印一封信”的任务,因此它包含您需要的内容?我假设你的公司控制着这个“任务”。 – Nelson