开发者

Using Javascript in Adobe Reader

I am currently using the following script for a few documents:

var pp = this.getPrintParams();
pp.interactive = pp.constants.interactionLevel.automatic;
this.print(pp);

How do I add another command, say document.close() so that it reads the print function 开发者_开发百科and then follows the close document last? Do I simply add the close command right after the print command so it would read

var pp = this.getPrintParams();
pp.interactive = pp.constants.interactionLevel.automatic;
this.print(pp);
document.close();

Thanks.

ADDITION

My problem here is I cannot figure out how to finish off one command and get right into the next. I have given up on trying to make the document close, since I realized it will open in the browser. So now my next idea is to use history.back(-1); after the print command. I just don't understand how to start/stop commands in the javascript.


add this history.go(-1); instead of history.back(-1);


The print function should block (pause) until the user finishes dealing with the print dialog, then continue. You don't have to do anything special to run more code after it.

That said, do you really need to force the document to close after it prints? As a user, I'd be pretty miffed if a website did this to me. What if I want to save the PDF to my computer? What if my printer was low on ink and I need to print it again? Let me decide when to close your PDF.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜