2014-09-05 07:44:07 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
2009-07-11 07:01:54 +00:00
|
|
|
<!-- $Revision$ -->
|
2007-06-20 22:25:43 +00:00
|
|
|
<refentry xml:id='function.fdf-add-doc-javascript' xmlns="http://docbook.org/ns/docbook">
|
2002-10-21 20:57:18 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>fdf_add_doc_javascript</refname>
|
|
|
|
<refpurpose>Adds javascript code to the FDF document</refpurpose>
|
|
|
|
</refnamediv>
|
2007-02-19 00:04:50 +00:00
|
|
|
|
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
2002-10-21 20:57:18 +00:00
|
|
|
<methodsynopsis>
|
|
|
|
<type>bool</type><methodname>fdf_add_doc_javascript</methodname>
|
2007-02-19 00:04:50 +00:00
|
|
|
<methodparam><type>resource</type><parameter>fdf_document</parameter></methodparam>
|
2002-10-21 20:57:18 +00:00
|
|
|
<methodparam><type>string</type><parameter>script_name</parameter></methodparam>
|
|
|
|
<methodparam><type>string</type><parameter>script_code</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
|
|
|
<para>
|
2007-02-19 00:04:50 +00:00
|
|
|
Adds a script to the FDF, which Acrobat then adds to the doc-level scripts
|
|
|
|
of a document, once the FDF is imported into it.
|
2002-10-21 20:57:18 +00:00
|
|
|
</para>
|
2007-02-19 00:04:50 +00:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="parameters">
|
|
|
|
&reftitle.parameters;
|
|
|
|
<para>
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>fdf_document</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The FDF document handle, returned by <function>fdf_create</function>,
|
|
|
|
<function>fdf_open</function> or <function>fdf_open_string</function>.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>script_name</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The script name.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>script_code</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The script code. It is strongly suggested to use <literal>\r</literal>
|
|
|
|
for linebreaks within the script code.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
|
|
|
<para>
|
|
|
|
&return.success;
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="examples">
|
|
|
|
&reftitle.examples;
|
2002-10-21 20:57:18 +00:00
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title>Adding JavaScript code to a FDF</title>
|
2003-08-16 17:06:53 +00:00
|
|
|
<programlisting role="php">
|
2002-10-21 20:57:18 +00:00
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
$fdf = fdf_create();
|
|
|
|
fdf_add_doc_javascript($fdf, "PlusOne", "function PlusOne(x)\r{\r return x+1;\r}\r");
|
|
|
|
fdf_save($fdf);
|
|
|
|
?>
|
|
|
|
]]>
|
|
|
|
</programlisting>
|
2007-02-19 00:04:48 +00:00
|
|
|
<simpara>
|
|
|
|
will create a FDF like this:
|
|
|
|
</simpara>
|
2002-10-21 20:57:18 +00:00
|
|
|
<screen>
|
|
|
|
<![CDATA[
|
|
|
|
%FDF-1.2
|
2009-04-02 12:58:06 +00:00
|
|
|
%âãÏÓ
|
2002-10-21 20:57:18 +00:00
|
|
|
1 0 obj
|
2007-02-19 00:04:48 +00:00
|
|
|
<<
|
|
|
|
/FDF << /JavaScript << /Doc [ (PlusOne)(function PlusOne\(x\)\r{\r return x+1;\r}\r)] >> >>
|
|
|
|
>>
|
2002-10-21 20:57:18 +00:00
|
|
|
endobj
|
|
|
|
trailer
|
|
|
|
<<
|
2007-02-19 00:04:48 +00:00
|
|
|
/Root 1 0 R
|
2002-10-21 20:57:18 +00:00
|
|
|
|
|
|
|
>>
|
|
|
|
%%EOF
|
|
|
|
]]>
|
|
|
|
</screen>
|
|
|
|
</example>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
2007-02-19 00:04:50 +00:00
|
|
|
|
2002-10-21 20:57:18 +00:00
|
|
|
</refentry>
|
|
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
|
|
|
sgml-omittag:t
|
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
indent-tabs-mode:nil
|
|
|
|
sgml-parent-document:nil
|
2009-09-25 07:04:39 +00:00
|
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
2002-10-21 20:57:18 +00:00
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:nil
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
|
|
vim: et tw=78 syn=sgml
|
|
|
|
vi: ts=1 sw=1
|
|
|
|
-->
|