/** Creates a JavaScript action. If the JavaScript is smaller than * 50 characters it will be place as a string, otherwise it will * be placed as a compressed stream. * @param code the JavaScript code * @param writer the writer for this action * @return the JavaScript action */ public static PdfAction javaScript(String code, PdfWriter writer) { return javaScript(code, writer, false); }
/** Creates a JavaScript action. If the JavaScript is smaller than * 50 characters it will be place as a string, otherwise it will * be placed as a compressed stream. * @param code the JavaScript code * @param writer the writer for this action * @return the JavaScript action */ public static PdfAction javaScript(String code, PdfWriter writer) { return javaScript(code, writer, false); }
/** * 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)); }
/** * 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)); }
/** * 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)); }
/** * 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)); }
/** Adds a JavaScript action at the document level. When the document * opens all this JavaScript runs. The existing JavaScript will be replaced. * @param name the name for the JavaScript snippet in the name tree * @param js the JavaScript code */ public void addJavaScript(final String name, final String js) { stamper.addJavaScript(name, PdfAction.javaScript(js, stamper, !PdfEncodings.isPdfDocEncoding(js))); }
/** Adds a JavaScript action at the document level. When the document * opens all this JavaScript runs. The existing JavaScript will be replaced. * @param name the name for the JavaScript snippet in the name tree * @param js the JavaScript code */ public void addJavaScript(final String name, final String js) { stamper.addJavaScript(name, PdfAction.javaScript(js, stamper, !PdfEncodings.isPdfDocEncoding(js))); }
public boolean setFieldAsJavascript(String field, PdfName jsTrigName, String js) { PdfAnnotation dict = wrt.createAnnotation(null, null); PdfAction javascript = PdfAction.javaScript(js, wrt); dict.put(jsTrigName, javascript); return setField(field, dict); }
public boolean setFieldAsJavascript(String field, PdfName jsTrigName, String js) { PdfAnnotation dict = wrt.createAnnotation(null, null); PdfAction javascript = PdfAction.javaScript(js, wrt); dict.put(jsTrigName, javascript); return setField(field, dict); }
String code = (String)map.get("Code"); if(code != null) { outline.put(PdfName.A, PdfAction.javaScript(code, writer));
String code = (String)map.get("Code"); if(code != null) { outline.put(PdfName.A, PdfAction.javaScript(code, writer));
action = PdfAction.javaScript(handler.getAttributeValue(elem, "onclick"), _writer); } else { action.put(PdfName.S, PdfName.GOTO);