com.itextpdf.text.pdf.PdfWriter.addJavaScript()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 JavaScript  
字(3.6k)|赞(0)|评价(0)|浏览(223)

本文整理了Java中com.itextpdf.text.pdf.PdfWriter.addJavaScript()方法的一些代码示例,展示了PdfWriter.addJavaScript()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。PdfWriter.addJavaScript()方法的具体详情如下:
包路径:com.itextpdf.text.pdf.PdfWriter
类名称:PdfWriter
方法名:addJavaScript

PdfWriter.addJavaScript介绍

[英]Use this method to add a JavaScript action at the document level. When the document opens, all this JavaScript runs.
[中]使用此方法在文档级别添加JavaScript操作。当文档打开时,所有这些JavaScript都会运行。

代码示例

代码示例来源:origin: com.itextpdf/itextpdf

/**
* Use this method to adds a JavaScript action at the document level.
* When the document opens, all this JavaScript runs.
* @param code the JavaScript code
*/
public void addJavaScript(final String code) {
  addJavaScript(code, false);
}
/**

代码示例来源:origin: com.itextpdf/itextpdf

/**
* Use this method to adds a JavaScript action at the document level.
* When the document opens, all this JavaScript runs.
* @param name    The name of the JS Action in the name tree
* @param code the JavaScript code
*/
public void addJavaScript(final String name, final String code) {
  addJavaScript(name, code, false);
}

代码示例来源:origin: com.itextpdf/itextg

/**
* Use this method to adds a JavaScript action at the document level.
* When the document opens, all this JavaScript runs.
* @param name    The name of the JS Action in the name tree
* @param code the JavaScript code
*/
public void addJavaScript(final String name, final String code) {
  addJavaScript(name, code, false);
}

代码示例来源:origin: com.itextpdf/itextg

/**
* Use this method to adds a JavaScript action at the document level.
* When the document opens, all this JavaScript runs.
* @param code the JavaScript code
*/
public void addJavaScript(final String code) {
  addJavaScript(code, false);
}
/**

代码示例来源:origin: stackoverflow.com

PdfWriter writer = stamper.getWriter();
writer.addJavaScript(Utilities.readFileToString(RESOURCE));

代码示例来源:origin: com.itextpdf/itextpdf

/**
* Use this method to add a JavaScript action at the document level.
* When the document opens, all this JavaScript runs.
* @param code the JavaScript code
* @param unicode select JavaScript unicode. Note that the internal
* Acrobat JavaScript engine does not support unicode,
* so this may or may not work for you
*/
public void addJavaScript(final String code, final boolean unicode) {
  addJavaScript(PdfAction.javaScript(code, this, unicode));
}

代码示例来源:origin: com.itextpdf/itextpdf

/**
* Use this method to add a JavaScript action at the document level.
* When the document opens, all this JavaScript runs.
* @param name    The name of the JS Action in the name tree
* @param code the JavaScript code
* @param unicode select JavaScript unicode. Note that the internal
* Acrobat JavaScript engine does not support unicode,
* so this may or may not work for you
*/
public void addJavaScript(final String name, final String code, final boolean unicode) {
  addJavaScript(name, PdfAction.javaScript(code, this, unicode));
}

代码示例来源:origin: com.itextpdf/itextg

/**
* Use this method to add a JavaScript action at the document level.
* When the document opens, all this JavaScript runs.
* @param code the JavaScript code
* @param unicode select JavaScript unicode. Note that the internal
* Acrobat JavaScript engine does not support unicode,
* so this may or may not work for you
*/
public void addJavaScript(final String code, final boolean unicode) {
  addJavaScript(PdfAction.javaScript(code, this, unicode));
}

代码示例来源:origin: com.itextpdf/itextg

/**
* Use this method to add a JavaScript action at the document level.
* When the document opens, all this JavaScript runs.
* @param name    The name of the JS Action in the name tree
* @param code the JavaScript code
* @param unicode select JavaScript unicode. Note that the internal
* Acrobat JavaScript engine does not support unicode,
* so this may or may not work for you
*/
public void addJavaScript(final String name, final String code, final boolean unicode) {
  addJavaScript(name, PdfAction.javaScript(code, this, unicode));
}

代码示例来源:origin: cn-cerc/summer-mis

writer.addJavaScript("this.print({bUI: true, bSilent: true,bShrinkToFit:true});", false);

相关文章

微信公众号

PdfWriter类方法