From 57831804ee8e7fcaeb03975ab9b5a6daa8ba04e8 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Tue, 22 Jun 2021 13:50:37 +0900 Subject: docassembly (new) --- texmf-dist/doc/latex/docassembly/README.md | 35 ++++ texmf-dist/doc/latex/docassembly/docassembly.pdf | Bin 0 -> 357824 bytes .../latex/docassembly/examples/attach-files.tex | 31 ++++ .../docassembly/examples/certifyinvisible.pdf | Bin 0 -> 135837 bytes .../docassembly/examples/certifyinvisible.tex | 151 +++++++++++++++ .../docassembly/examples/create-templates.tex | 66 +++++++ .../doc/latex/docassembly/examples/doc-saveas.tex | 27 +++ .../latex/docassembly/examples/extract-pages.tex | 24 +++ .../docassembly/examples/graphics/AdobeDon-btn.pdf | Bin 0 -> 80868 bytes .../docassembly/examples/graphics/AdobeDon.pdf | Bin 0 -> 85289 bytes .../docassembly/examples/graphics/AdobeDonIcon.pdf | Bin 0 -> 78327 bytes .../docassembly/examples/graphics/AeB_Logo.pdf | Bin 0 -> 34683 bytes .../latex/docassembly/examples/graphics/girl.pdf | Bin 0 -> 415673 bytes .../latex/docassembly/examples/graphics/man1.pdf | Bin 0 -> 416225 bytes .../latex/docassembly/examples/graphics/scot.pdf | Bin 0 -> 409204 bytes .../latex/docassembly/examples/import-icons.tex | 56 ++++++ .../latex/docassembly/examples/import-sound.tex | 24 +++ .../latex/docassembly/examples/insert-pages.tex | 20 ++ .../doc/latex/docassembly/examples/mail-doc.tex | 31 ++++ .../doc/latex/docassembly/examples/open-doc.tex | 34 ++++ .../docassembly/examples/resources/myStory.pdf | Bin 0 -> 34655 bytes .../docassembly/examples/resources/supportDoc.pdf | Bin 0 -> 7358 bytes texmf-dist/doc/latex/docassembly/examples/sign.pdf | Bin 0 -> 171458 bytes texmf-dist/doc/latex/docassembly/examples/sign.tex | 206 +++++++++++++++++++++ .../doc/latex/docassembly/examples/sounds/trek.wav | Bin 0 -> 89864 bytes .../latex/docassembly/examples/watermark-file.tex | 25 +++ .../latex/docassembly/examples/watermark-text.tex | 26 +++ 27 files changed, 756 insertions(+) create mode 100644 texmf-dist/doc/latex/docassembly/README.md create mode 100644 texmf-dist/doc/latex/docassembly/docassembly.pdf create mode 100644 texmf-dist/doc/latex/docassembly/examples/attach-files.tex create mode 100644 texmf-dist/doc/latex/docassembly/examples/certifyinvisible.pdf create mode 100644 texmf-dist/doc/latex/docassembly/examples/certifyinvisible.tex create mode 100644 texmf-dist/doc/latex/docassembly/examples/create-templates.tex create mode 100644 texmf-dist/doc/latex/docassembly/examples/doc-saveas.tex create mode 100644 texmf-dist/doc/latex/docassembly/examples/extract-pages.tex create mode 100644 texmf-dist/doc/latex/docassembly/examples/graphics/AdobeDon-btn.pdf create mode 100644 texmf-dist/doc/latex/docassembly/examples/graphics/AdobeDon.pdf create mode 100644 texmf-dist/doc/latex/docassembly/examples/graphics/AdobeDonIcon.pdf create mode 100644 texmf-dist/doc/latex/docassembly/examples/graphics/AeB_Logo.pdf create mode 100644 texmf-dist/doc/latex/docassembly/examples/graphics/girl.pdf create mode 100644 texmf-dist/doc/latex/docassembly/examples/graphics/man1.pdf create mode 100644 texmf-dist/doc/latex/docassembly/examples/graphics/scot.pdf create mode 100644 texmf-dist/doc/latex/docassembly/examples/import-icons.tex create mode 100644 texmf-dist/doc/latex/docassembly/examples/import-sound.tex create mode 100644 texmf-dist/doc/latex/docassembly/examples/insert-pages.tex create mode 100644 texmf-dist/doc/latex/docassembly/examples/mail-doc.tex create mode 100644 texmf-dist/doc/latex/docassembly/examples/open-doc.tex create mode 100644 texmf-dist/doc/latex/docassembly/examples/resources/myStory.pdf create mode 100644 texmf-dist/doc/latex/docassembly/examples/resources/supportDoc.pdf create mode 100644 texmf-dist/doc/latex/docassembly/examples/sign.pdf create mode 100644 texmf-dist/doc/latex/docassembly/examples/sign.tex create mode 100644 texmf-dist/doc/latex/docassembly/examples/sounds/trek.wav create mode 100644 texmf-dist/doc/latex/docassembly/examples/watermark-file.tex create mode 100644 texmf-dist/doc/latex/docassembly/examples/watermark-text.tex (limited to 'texmf-dist/doc/latex') diff --git a/texmf-dist/doc/latex/docassembly/README.md b/texmf-dist/doc/latex/docassembly/README.md new file mode 100644 index 00000000..e5897f2e --- /dev/null +++ b/texmf-dist/doc/latex/docassembly/README.md @@ -0,0 +1,35 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% docassembly.sty package, %% +%% Copyright (C) 2021 D. P. Story %% +%% dpstory@acrotex.net %% +%% %% +%% This program can redistributed and/or modified under %% +%% the terms of the LaTeX Project Public License %% +%% Distributed from CTAN archives in directory %% +%% macros/latex/base/lppl.txt; either version 1.2 of %% +%% the License, or (at your option) any later version. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +Dated: 2021-06-19 + +Targeted audience: LaTeX authors who love their pdflatex, lualtex, xelatex, +or dvips -> ps2pdf workflow, who also own Acrobat Pro application. + +The docassembly package defines the docassembly environment in which +JavaScript code can be written to execute once and only once the newly +created PDF in the Acrobat application. The package also defines a series of +helper commands to execute security restricted JavaScript methods. Using +these security restricted commands, you can place watermarks on the document, +attached files, import icons and sounds, insert pages, extract pages, send +email, and so on. All these methods I have used for years through the aeb_pro +package, which generally restricted to a dvips -> distiller workflow. Now, +these methods are available to all those who own Acrobat, no matter what PDF +creator used. + +What's New (2021-06-19) Moved some documentation from this package to + the acrotex-js package. New require acrotex-js dated 2021/06/19 or later. + +Now, I simply must get back to my retirement. + +D. P. Story +dpstory@acrotex.net + diff --git a/texmf-dist/doc/latex/docassembly/docassembly.pdf b/texmf-dist/doc/latex/docassembly/docassembly.pdf new file mode 100644 index 00000000..c782c598 Binary files /dev/null and b/texmf-dist/doc/latex/docassembly/docassembly.pdf differ diff --git a/texmf-dist/doc/latex/docassembly/examples/attach-files.tex b/texmf-dist/doc/latex/docassembly/examples/attach-files.tex new file mode 100644 index 00000000..6bec57ab --- /dev/null +++ b/texmf-dist/doc/latex/docassembly/examples/attach-files.tex @@ -0,0 +1,31 @@ +\documentclass{article} +\usepackage{docassembly} +\usepackage{lipsum} + +\hypersetup{pdfpagemode=UseAttachments} + +% Look in the Adobe Acrobat JavaScript manual under the doc.importDataObject to see all the possible parameters. +\begin{docassembly} +% Or use \attachFile instead of \importDataObject +var retn = \importDataObject({ + cName: "job", + cDIPath: "\jobname.tex" +}); +% The next line creates a meaningful description of the attachment +if (retn) this.getDataObject("job").description="Source file for this PDF"; +% You can have more than one file attachments +var retn = \attachFile({ + cName: "AdobeDon", + cDIPath: "graphics/AdobeDon.pdf" +}); +% The next line creates a meaningful description of the attachment +if (retn) this.getDataObject("AdobeDon").description="The one and only AdobeDon"; +% ... +\executeSave(); +\end{docassembly} + +\begin{document} + +\lipsum[1-30] + +\end{document} \ No newline at end of file diff --git a/texmf-dist/doc/latex/docassembly/examples/certifyinvisible.pdf b/texmf-dist/doc/latex/docassembly/examples/certifyinvisible.pdf new file mode 100644 index 00000000..d00c7704 Binary files /dev/null and b/texmf-dist/doc/latex/docassembly/examples/certifyinvisible.pdf differ diff --git a/texmf-dist/doc/latex/docassembly/examples/certifyinvisible.tex b/texmf-dist/doc/latex/docassembly/examples/certifyinvisible.tex new file mode 100644 index 00000000..b4205b71 --- /dev/null +++ b/texmf-dist/doc/latex/docassembly/examples/certifyinvisible.tex @@ -0,0 +1,151 @@ +\documentclass[12pt]{article} +\usepackage{eforms} +\usepackage{docassembly} +\usepackage{fancyvrb} + +\hypersetup{pdfpagemode=UseNone} + +\newcommand{\cs}[1]{\texttt{\char`\\#1}} + +\pagestyle{empty} +\parskip\medskipamount +\parindent0pt + +% Do not compile until you have a digital ID and password +% Actually, you can compile, but do not bring the PDF into Acrobat until you have a digital ID and password. +% You can view the PDF in other PDF viewers such as SumatraPDF. +\begin{docassembly} +\sigInfo{ + cert: ".pfx", + password: "", + oInfo: { + location: "AcroTeX Central, FL", + reason: "I am certifying this document", + mdp: "defaultAndComments", + contactInfo: "dpspeaker@talking@edu" + } +}; +\certifyInvisibleSign +\end{docassembly} + +\begin{document} + + +%\maketitle + +\hfill\smash{\raisebox{-\baselineskip}{March 23, 2009}} + +\begin{tabular}{@{}ll} +To: &Honorable Barrister Maxwell Frimpong\\ +From: &D. P. Speaker\\ +Subject: &On Business Proposal\\ +\end{tabular} + +\vspace{2\baselineskip} + +Dear Mr.\ Frimpong; + +Thank you for thinking of me concerning an ``important business proposal'' in +your recent and brief email to me on March 23, 2009. Recovering \$12,000,000 +(twelve million Us dollars) in claims sounds intriguing and exciting to me. +Such a large amount of money would certainly come in handy in these tough +times. Yet, regrettably, I must decline your kind offer; though I am in +retirement, I am, none-the-less, quite busy lately sorting my button +collection and don't really have the time to pick up all this easy money. + +Thank you again, Barrister Frimpong, for your offer. Please keep me +in mind should future opportunities arise. + + +\vspace{2\baselineskip} + +Best regards,\\ +\sigField{sigOfDPS}{2.5in}{4\baselineskip}\\[3pt] +Dr.\ D. P. Speaker\\ +Department of Rhetoric\\ +Talking University\\ +Talkville, FL 12345\\ +\texttt{dpspeaker@talking.edu} + +\newpage + +\section{Creating and Signing a Certified Invisible Signature} + +The \textsf{docassembly} package can create a \emph{certified invisible +signature}. You create an certified invisible signature either through the +user-interface of \textsf{Acrobat} or programmatically using JavaScript. With +JavaScript (and \textsf{docassembly}, a trusted version of the +\texttt{\textsl{Doc}.certifyInvisibleSign()} method is used to certify the +document. The certification can be seen by opening the Signature panel +(part of the left-hand panel system of the user-interface). + +Also included is an approval signature, as usual, at the end of the letter. Open +this PDF and sign using your own digital ID. Signing should not invalidate +the certification. + +The certify invisible sign is done within the \texttt{docassembly} +environment, the script follows: +\begin{Verbatim}[xleftmargin=20pt,fontsize=\small] +\begin{docassembly} +\sigInfo{ + cert: ".pfx", password: "", + oInfo: { + location: "AcroTeX Central, FL", + reason: "I am certifying this document", + mdp: "defaultAndComments", + contactInfo: "dpspeaker@talking.edu" + } +}; +\certifyInvisibleSign +\end{docassembly} +\end{Verbatim} +The setup is similar to certify sign, but without the key +\texttt{cSigFieldName}, used to specify a particular field to be signed. +An invisible signature field \emph{is created and signed} using the method +\texttt{\textsl{Doc}.certifyInvisibleSign()}. + + +The \cs{sigInfo} contains the usual property list, excluding +\texttt{cSigFieldName}. The command \cs{certifyInvisibleSign} +uses the information in this object and calls the trusted version +of \texttt{\textsl{Doc}.certifyInvisibleSign()}, which is defined in +\texttt{aeb\_pro.js}. + +Additional information on signatures is found at the +\textbf{Acrobat Developer Center}.\footnote{\url{http://www.adobe.com/go/acrobat_developer}} +Refer to the \emph{JavaScript for Acrobat API Reference}, also found at the \textbf{Acrobat Developer Center}, +for details on these methods and their parameters. Adobe is +notorious for moving its reference documents and renaming them, year after +year. Good luck searching the Adobe web site for the references you need. + +\section{Compiling this file} + +In the preamble of this document, the \texttt{docassembly} environment is found: +\begin{Verbatim}[xleftmargin=20pt,fontsize=\small] +\begin{docassembly} +\sigInfo{ + cert: ".pfx", password: "", + oInfo: { + location: "AcroTeX Central, FL", + reason: "I am certifying this document", + mdp: "defaultAndComments", + contactInfo: "dpspeaker@talking.edu" + } +}; +\certifyInvisibleSign +\end{docassembly} +\end{Verbatim} +To compile this document yourself, you need to create a digital ID using +\textsf{Acrobat}. Replace \texttt{} with the file name of your digital +ID. and of course replace \texttt{} with the password you selected +when you created your digital ID. Modify the \texttt{oInfo} property as +designed. + + +Now, back to my retirement. + +\end{document} + +References: Try +Digital Signatures Workflow Guide +http://www.adobe.com/devnet-docs/acrobatetk/tools/DigSig/index.html diff --git a/texmf-dist/doc/latex/docassembly/examples/create-templates.tex b/texmf-dist/doc/latex/docassembly/examples/create-templates.tex new file mode 100644 index 00000000..62694179 --- /dev/null +++ b/texmf-dist/doc/latex/docassembly/examples/create-templates.tex @@ -0,0 +1,66 @@ +\documentclass{article} +\usepackage{xcolor} +\usepackage{docassembly} +\usepackage{eforms} +\usepackage{lipsum} + +\hypersetup{pdfpagemode=UseNone,colorlinks} + +\begin{defineJS}{\ADActn} +if (typeof tmplObj != "object") + tmplObj=this.getTemplate("AdobeDon"); +tmplObj.spawn({ + nPage: 0, + bOverlay:false, + oXObject: tmplObj +}); +\end{defineJS} +\begin{defineJS}{\contActn} +if (typeof tmplObjSpawn != "object") { + var tmplObjSpawn=this.getTemplate("myStory"); + tmplObjSpawn.spawn({ + nPage: this.pageNum+1, + bOverlay:false, + oXObject: tmplObjSpawn + }); + this.pageNum++; +} +\end{defineJS} + +% Look in the Adobe Acrobat JavaScript manual under the Doc.createTemplate to see all the possible parameters. +\begin{docassembly} +\insertPages({ + nPage: -1, + cPath: "graphics/AdobeDon-btn.pdf" +}); +var tmplObj=\createTemplate({cName: "AdobeDon", nPage: 0}); +tmplObj.hidden=true; +\insertPages({ + nPage: -1, + cPath: "resources/myStory.pdf" +}); +var tmplObj1=\createTemplate({cName: "myStory", nPage: 0}); +tmplObj1.hidden=true; +\executeSave(); +\end{docassembly} + +\begin{document} + +\noindent +\pushButton[\CA{View author}\AAmouseup{\ADActn}]{vTmpl}{}{11bp}\medskip + +\noindent +\lipsum[1-4]\medskip + +\noindent +Write a short history of your life. Press the \textsf{Continue} link if you need more space for your story, and then continue on the +next page.\medskip + +\noindent +\textField[\Ff\FfMultiline]{myStory}{\linewidth}{3\baselineskip}\\[6bp]\null +\hfill\setLink[\A{\JS{\contActn}}\linktxtcolor{red}]{Continue on next page as needed} + +\newpage +\noindent\lipsum[5-10] + +\end{document} diff --git a/texmf-dist/doc/latex/docassembly/examples/doc-saveas.tex b/texmf-dist/doc/latex/docassembly/examples/doc-saveas.tex new file mode 100644 index 00000000..38df5985 --- /dev/null +++ b/texmf-dist/doc/latex/docassembly/examples/doc-saveas.tex @@ -0,0 +1,27 @@ +\documentclass{article} +\usepackage{docassembly} +\usepackage{lipsum} + +\hypersetup{pdfpagemode=UseNone} + +% Look in the Adobe Acrobat JavaScript manual under the doc.saveAs() to see all the possible parameters. +\begin{docassembly} +% save a copy of this PDF for the archives +var retn=\docSaveAs({ + cPath: "\jobname-copy.pdf", + bCopy: true +}); +% This method can also be used to make conversions, for example, you can save a PDF as a PNG +% Here, we make a PNG image of each page in this document. +var retn=\docSaveAs({ + cConvID: "com.adobe.acrobat.png", + cPath: "\jobname.png" +}); +\executeSave(); +\end{docassembly} + +\begin{document} + +\lipsum[1-30] + +\end{document} \ No newline at end of file diff --git a/texmf-dist/doc/latex/docassembly/examples/extract-pages.tex b/texmf-dist/doc/latex/docassembly/examples/extract-pages.tex new file mode 100644 index 00000000..7cfc1af7 --- /dev/null +++ b/texmf-dist/doc/latex/docassembly/examples/extract-pages.tex @@ -0,0 +1,24 @@ +\documentclass{article} +\usepackage{docassembly} +\usepackage{lipsum} + +\hypersetup{pdfpagemode=UseNone} + +% Look in the Adobe Acrobat JavaScript manual under the doc.extractPages to see all the possible parameters. +% nStart and nEnd are 0-based page numbers, so nStart:1 and nEnd:2 extracts pages 2 and 3 +\begin{docassembly} +\retnAbsPathAs(_path); +_path += "/extracted-pages.pdf"; +\extractPages({ + nStart: 1, + nEnd: 2, + cPath: _path +}); +\executeSave(); +\end{docassembly} + +\begin{document} + +\lipsum[1-30] + +\end{document} \ No newline at end of file diff --git a/texmf-dist/doc/latex/docassembly/examples/graphics/AdobeDon-btn.pdf b/texmf-dist/doc/latex/docassembly/examples/graphics/AdobeDon-btn.pdf new file mode 100644 index 00000000..7ec1ff98 Binary files /dev/null and b/texmf-dist/doc/latex/docassembly/examples/graphics/AdobeDon-btn.pdf differ diff --git a/texmf-dist/doc/latex/docassembly/examples/graphics/AdobeDon.pdf b/texmf-dist/doc/latex/docassembly/examples/graphics/AdobeDon.pdf new file mode 100644 index 00000000..2968aa40 Binary files /dev/null and b/texmf-dist/doc/latex/docassembly/examples/graphics/AdobeDon.pdf differ diff --git a/texmf-dist/doc/latex/docassembly/examples/graphics/AdobeDonIcon.pdf b/texmf-dist/doc/latex/docassembly/examples/graphics/AdobeDonIcon.pdf new file mode 100644 index 00000000..284f3d8c Binary files /dev/null and b/texmf-dist/doc/latex/docassembly/examples/graphics/AdobeDonIcon.pdf differ diff --git a/texmf-dist/doc/latex/docassembly/examples/graphics/AeB_Logo.pdf b/texmf-dist/doc/latex/docassembly/examples/graphics/AeB_Logo.pdf new file mode 100644 index 00000000..c41d81c4 Binary files /dev/null and b/texmf-dist/doc/latex/docassembly/examples/graphics/AeB_Logo.pdf differ diff --git a/texmf-dist/doc/latex/docassembly/examples/graphics/girl.pdf b/texmf-dist/doc/latex/docassembly/examples/graphics/girl.pdf new file mode 100644 index 00000000..4ab32d82 Binary files /dev/null and b/texmf-dist/doc/latex/docassembly/examples/graphics/girl.pdf differ diff --git a/texmf-dist/doc/latex/docassembly/examples/graphics/man1.pdf b/texmf-dist/doc/latex/docassembly/examples/graphics/man1.pdf new file mode 100644 index 00000000..10721588 Binary files /dev/null and b/texmf-dist/doc/latex/docassembly/examples/graphics/man1.pdf differ diff --git a/texmf-dist/doc/latex/docassembly/examples/graphics/scot.pdf b/texmf-dist/doc/latex/docassembly/examples/graphics/scot.pdf new file mode 100644 index 00000000..3133d053 Binary files /dev/null and b/texmf-dist/doc/latex/docassembly/examples/graphics/scot.pdf differ diff --git a/texmf-dist/doc/latex/docassembly/examples/import-icons.tex b/texmf-dist/doc/latex/docassembly/examples/import-icons.tex new file mode 100644 index 00000000..147839fa --- /dev/null +++ b/texmf-dist/doc/latex/docassembly/examples/import-icons.tex @@ -0,0 +1,56 @@ +\documentclass{article} +\usepackage{docassembly} +\usepackage{eforms} +\usepackage{lipsum} + +\hypersetup{pdfpagemode=UseNone} + +% Look in the Adobe Acrobat JavaScript manual under the doc.importIcon to see all the possible parameters. +\begin{docassembly} + var retn=\importIcon({cName:"A man",cDIPath:"graphics/man1.pdf"}); + if ( retn < 0 ) console.println("The file man1.pdf could not be opened or is invalid"); + var retn=\importIcon({cName:"A girl",cDIPath:"graphics/girl.pdf"}); + if ( retn < 0 ) console.println("The file girl.pdf could not be opened or is invalid"); + var retn=\importIcon({cName:"A scotsman",cDIPath:"graphics/scot.pdf"}); + if ( retn < 0 ) console.println("The file scot.pdf could not be opened or is invalid"); + var retn=\importIcon({cName:"AdobeDon",cDIPath:"graphics/AdobeDonIcon.pdf"}); + if ( retn < 0 ) console.println("The file AdobeDonIcon.pdf could not be opened or is invalid"); +\executeSave(); +\end{docassembly} + +\begin{document} + +\begin{defineJS}{\cycleJS} +if (typeof indexIcon == "undefined") var indexIcon=0; +var oIconName=this.icons[indexIcon].name; +var f=this.getField("iconContainer"); +var oIcon=this.getIcon(oIconName); +f.buttonPosition=position.iconTextV; +f.buttonSetIcon(oIcon); +f.buttonSetCaption(oIconName); +indexIcon = (indexIcon+1) \% (this.icons.length); +\end{defineJS} +% define a clear button feature, it clears the button iconContainer +% so it no longer displays an icon; pressing the Cycle button resumes +% the display as before. +\begin{defineJS}{\clearJS} +f=this.getField("iconContainer") +// save +var sv=f.buttonPosition; +var cptn=f.buttonGetCaption(); +// clear +f.buttonPosition=position.textOnly; +f.buttonSetCaption(""); +\end{defineJS} + +\begin{center}\Large\bfseries +A slide show of Icons and Photos +\end{center} + +\begin{center} +\pushButton[\BG{}\TP{2}\S{S}]{iconContainer}{100bp}{100bp}\vcgBdry[6bp] +\pushButton[\CA{Cycle}\AAmouseup{\cycleJS}]{cycleBtn}{}{11bp}\cgBdry[3bp] +\pushButton[\CA{Clear}\AAmouseup{\clearJS}]{clearBtn}{}{11bp} +\end{center} +\end{document} + diff --git a/texmf-dist/doc/latex/docassembly/examples/import-sound.tex b/texmf-dist/doc/latex/docassembly/examples/import-sound.tex new file mode 100644 index 00000000..19f7be11 --- /dev/null +++ b/texmf-dist/doc/latex/docassembly/examples/import-sound.tex @@ -0,0 +1,24 @@ +\documentclass{article} +\usepackage{docassembly} +\usepackage{eforms} +%\usepackage{lipsum} + +\hypersetup{pdfpagemode=UseNone} + +% Look in the Adobe Acrobat JavaScript manual under the doc.importSound to see all the possible parameters. +\begin{docassembly} +\importSound({cName: "StarTrek", cDIPath: "sounds/trek.wav" }); +\executeSave(); +\end{docassembly} + +\begin{document} + + +\begin{center} +\pushButton[\CA{Star Trek}\S{S}\W{0}\AAmouseup{% + var s = this.getSound("StarTrek");\r + s.play(); +}]{stSound}{}{11bp} + +\end{center} +\end{document} \ No newline at end of file diff --git a/texmf-dist/doc/latex/docassembly/examples/insert-pages.tex b/texmf-dist/doc/latex/docassembly/examples/insert-pages.tex new file mode 100644 index 00000000..eedbaab1 --- /dev/null +++ b/texmf-dist/doc/latex/docassembly/examples/insert-pages.tex @@ -0,0 +1,20 @@ +\documentclass{article} +\usepackage{docassembly} +\usepackage{lipsum} + +\hypersetup{pdfpagemode=UseNone} + +% Review doc.insertPages in the Acrobat JavaScript reference +\begin{docassembly} +\insertPages({ + nPage: this.numPages-1, + cPath: "graphics/AdobeDon.pdf" +}); +\executeSave(); +\end{docassembly} + +\begin{document} + +\lipsum[1-30] + +\end{document} \ No newline at end of file diff --git a/texmf-dist/doc/latex/docassembly/examples/mail-doc.tex b/texmf-dist/doc/latex/docassembly/examples/mail-doc.tex new file mode 100644 index 00000000..6240c945 --- /dev/null +++ b/texmf-dist/doc/latex/docassembly/examples/mail-doc.tex @@ -0,0 +1,31 @@ +\documentclass{article} +\usepackage{docassembly} +\usepackage{lipsum} + +\hypersetup{pdfpagemode=UseNone} + +% Look in the Adobe Acrobat JavaScript manual under the doc.mailDoc to see all the possible parameters. +\begin{docassembly} +% Prior to sending this document, you can attach files this this PDF +% Refer to attach-files.tex +var retn = \attachFile({ + cName: "AdobeDon", + cDIPath: "graphics/AdobeDon.pdf" +}); +% The next line creates a meaningful description of the attachment +if (retn) this.getDataObject("AdobeDon").description="The one and only AdobeDon"; +\executeSave(); +\mailDoc({ + bUI: false, + cTo: "dpstory@hotmail.com", + cSubject: "I'm testing things out", + cMsg: "Good to hear from you again Don. I'm emailing this PDF, attached, for your review." +}); +%\executeSave(); +\end{docassembly} + +\begin{document} + +\lipsum[1-30] + +\end{document} \ No newline at end of file diff --git a/texmf-dist/doc/latex/docassembly/examples/open-doc.tex b/texmf-dist/doc/latex/docassembly/examples/open-doc.tex new file mode 100644 index 00000000..4b861b79 --- /dev/null +++ b/texmf-dist/doc/latex/docassembly/examples/open-doc.tex @@ -0,0 +1,34 @@ +\documentclass{article} +\usepackage{docassembly} +\usepackage{lipsum} + +\hypersetup{pdfpagemode=UseNone} + +% Look in the Adobe Acrobat JavaScript manual under the app.openDoc() to see all the possible parameters. +\begin{docassembly} +% Open supportDoc.pdf, but hide it +var doc=\appopenDoc({ + oDoc: this, + cPath: "resources/supportDoc.pdf", + bHidden: true +}); +console.clear(); console.show(); +console.println("Opening " + doc.documentFileName); +% Get the field object, for the text field that has title of "Name" +console.println("Getting the field value of \"Name\""); +var f=doc.getField("Name"); +% Show the value of that text field and display it in the console +console.println("The value of \"Name\" is "+f.value); +% Close the hidden doc +console.println("Closing " + doc.documentFileName); +doc.closeDoc(); +% Save the current document +console.println("Saving the current document " + this.documentFileName); +\executeSave(); +\end{docassembly} + +\begin{document} + +\lipsum[1-30] + +\end{document} \ No newline at end of file diff --git a/texmf-dist/doc/latex/docassembly/examples/resources/myStory.pdf b/texmf-dist/doc/latex/docassembly/examples/resources/myStory.pdf new file mode 100644 index 00000000..a4549d21 Binary files /dev/null and b/texmf-dist/doc/latex/docassembly/examples/resources/myStory.pdf differ diff --git a/texmf-dist/doc/latex/docassembly/examples/resources/supportDoc.pdf b/texmf-dist/doc/latex/docassembly/examples/resources/supportDoc.pdf new file mode 100644 index 00000000..c34ac72f Binary files /dev/null and b/texmf-dist/doc/latex/docassembly/examples/resources/supportDoc.pdf differ diff --git a/texmf-dist/doc/latex/docassembly/examples/sign.pdf b/texmf-dist/doc/latex/docassembly/examples/sign.pdf new file mode 100644 index 00000000..b1fdef0f Binary files /dev/null and b/texmf-dist/doc/latex/docassembly/examples/sign.pdf differ diff --git a/texmf-dist/doc/latex/docassembly/examples/sign.tex b/texmf-dist/doc/latex/docassembly/examples/sign.tex new file mode 100644 index 00000000..0581f1eb --- /dev/null +++ b/texmf-dist/doc/latex/docassembly/examples/sign.tex @@ -0,0 +1,206 @@ +% C:\Users\dpstory\AppData\Roaming\Adobe\Acrobat\Beta\Security\DonStory.pfx +\documentclass[12pt]{article} +\usepackage{eforms} +\usepackage{docassembly} +\usepackage{fancyvrb} + +\hypersetup{pdfpagemode=UseNone} + + +\newcommand{\cs}[1]{\texttt{\char`\\#1}} + +\pagestyle{empty} +\parskip\medskipamount +\parindent0pt + +% Do not compile until you have a digital ID and password +% Actually, you can compile, but do not bring the PDF into Acrobat until you have a digital ID and password. +% You can view the PDF in other PDF viewers such as SumatraPDF. +\begin{docassembly} +\sigInfo{ + cSigFieldName: "sigOfDPS", + cert: "D_P_Speaker.pfx", + password: "password", + oInfo: { + location: "AcroTeX Central, FL", + reason: "I am approving this document for distribution", + contactInfo: "dpspeaker@talking.edu", + appearance: "My Signature" +% appearance: "My Image" + } +}; +\signatureSign +\end{docassembly} + +\begin{document} + + +%\maketitle + +\hfill\smash{\raisebox{-\baselineskip}{March 23, 2009}} + +\begin{tabular}{@{}ll} +To: &Honorable Barrister Maxwell Frimpong\\ +From: &D. P. Speaker\\ +Subject: &On Business Proposal\\ +\end{tabular} + +\vspace{2\baselineskip} + +Dear Mr.\ Frimpong; + +Thank you for thinking of me concerning an ``important business proposal'' in +your recent and brief email to me on March 23, 2009. Recovering \$12,000,000 +(twelve million US dollars) in claims sounds intriguing and exciting to me. +Such a large amount of money would certainly come in handy in these tough +times. Yet, regrettably, I must decline your kind offer; though I am in +retirement, I am, none-the-less, quite busy lately sorting my button +collection, and don't really have the time to pick up all this easy money. + +Thank you again, Barrister Frimpong, for your offer. Please keep me +in mind should future opportunities arise. + + +\vspace{2\baselineskip} + +Best regards,\\ +\sigField{sigOfDPS}{2.5in}{4\baselineskip}\\[3pt] +Dr.\ D. P. Speaker\\ +Department of Rhetoric,\\ +Talking University\\ +Talkville, FL 12345\\ +\texttt{dpspeaker@talking.edu} + + +\newpage + +\section{Creating and Signing a Signature Field} + +The \textsf{eforms} package can create a signature field with the \cs{sigField} command, and +using the \textsf{aeb\_pro} package with its \texttt{docassembly} environment, can also sign the field +from a {\LaTeX} source. + +The {\LaTeX} code for creating the signature field of this document is +\begin{Verbatim}[xleftmargin=20pt,fontsize=\small] +Best regards,\\ +\sigField{sigOfDPS}{2.5in}{4\baselineskip}\\[3pt] +Dr.\ D. P. Speaker\\ +Department of Rhetoric,\\ +Talking University\\ +Talkville, FL 12345\\ +\texttt{dpspeaker@talking.edu} +\end{Verbatim} +The \cs{sigField} command appears in the second line, and uses the usual +syntax for form fields, as defined in the \textsf{eforms} package. +Here's what the field looks like when it is unsigned. + +\sigField{sigOfDPS1}{2.5in}{4\baselineskip} + +Once the field is created, it can be signed using the Acrobat or Adobe +Reader (version 10.0.1 or later) user interface. + +A signature field may also be signed programmatically from the {\LaTeX} +source file using AeB Pro. The first signature field of this document +was automatically signed when the newly created PDF is brought into +Acrobat. +\begin{Verbatim}[xleftmargin=20pt,fontsize=\footnotesize] +\begin{docassembly} +\sigInfo{ + cSigFieldName: "sigOfDPS", + cert: ".pfx", password: "", + oInfo: { + location: "AcroTeX Central, FL", + reason: "I am approving this document for distribution", + contactInfo: "dpspeaker@talking.edu", + appearance: "My Signature" } +}; +\signatureSign +\end{docassembly} +\end{Verbatim} +The script above was used to programmatically sign the signature field +with field name of \texttt{sigOfDPS}. The value of the \texttt{password} +key to protect my secrets. The first command, \cs{sigInfo}, creates an +JavaScript object, \texttt{oSigInfo}. The command \cs{signatureSign} uses +the information in this object to sign the field designated by the +\texttt{cSigFieldName} property. + +The general syntax of the argument of \cs{sigInfo} is displayed below. +\def\meta#1{$\langle\textsl{\texttt{#1}}\rangle$} +\begin{Verbatim}[xleftmargin=20pt,fontsize=\footnotesize,commandchars={!()}] +\sigInfo{ + cSigFieldName: "!meta(sigFldName)", + oHandler: !meta(securityHandlerObj), + path2Cert: !meta(path), + cert: "!meta(certName).pfx", + password: "!meta(password)", + bUI: true|false; + oInfo: { + !meta(various properties) + } +} +\end{Verbatim} +The first five keys are used by AeB Pro to build the proper information +needed sign the field. +\begin{description} + \item[\normalfont\texttt{cSigFieldName} (required)] The + name of the signature field to be signed. + \item[\normalfont\texttt{oHandler} (optional)] The security + handler to be used. If this key is not present, + \texttt{security.PPKLiteHandler} is used. + \item[\normalfont\texttt{path2Cert} (optional)] The + device-independent path to the PFX file to be used. If not + present, AeB Pro uses the name provided by the \texttt{cert} key + and builds the path to where Acrobat normally saves digital IDs. + \item[\normalfont\texttt{cert} (optional)] The name of the digital + ID to be used for signing. Optional if \texttt{path2Cert} is + provided, required otherwise. + \item[\normalfont\texttt{password} (required)] The password for the PFX file + provided, necessary to login to the security handler (\texttt{oHandler}). + \item [\normalfont\texttt{bUI} (optional)] A Boolean, if + \texttt{true} the security handler displays the user interface + when signing. The default is \texttt{false}. + \item[\normalfont\texttt{oInfo} (optional)] The \texttt{oInfo} property key is + one that appears in the argument property list of the + \texttt{\textsl{Field}.signatureSign()} method. It is passed to + the argument of this JavaScript method. See the documentation of + \texttt{\textsl{Field}.signatureSign()} in the + \emph{JavaScript for Acrobat API Reference} for more information. +\end{description} + +Additional information on signatures is found at the +\textbf{Acrobat Developer Center}.\footnote{\url{http://www.adobe.com/go/acrobat_developer}} +Refer to the \emph{JavaScript for Acrobat API Reference}, also found at the \textbf{Acrobat Developer Center}, +for details on these methods and their parameters. Adobe is +notorious for moving its reference documents and renaming them, year after +year. Good luck searching the Adobe web site for the references you need. + +\section{Compiling this file} + +In the preamble of this document, the \texttt{docassembly} environment is found: +\begin{Verbatim}[xleftmargin=20pt,fontsize=\small] +\begin{docassembly} +\sigInfo{ + cert: ".pfx", password: "", + oInfo: { + location: "AcroTeX Central, FL", + reason: "I am certifying this document", + mdp: "defaultAndComments", + contactInfo: "dpspeaker@talking.edu" + } +}; +\certifyInvisibleSign +\end{docassembly} +\end{Verbatim} +To compile this document yourself, you need to create a digital ID using +\textsf{Acrobat}. Replace \texttt{} with the file name of your digital +ID. and of course replace \texttt{} with the password you selected +when you created your digital ID. Modify the \texttt{oInfo} property as +designed. + + +Now, back to my retirement. + +\end{document} + +Digital Signatures Workflow Guide +http://www.adobe.com/devnet-docs/acrobatetk/tools/DigSig/index.html diff --git a/texmf-dist/doc/latex/docassembly/examples/sounds/trek.wav b/texmf-dist/doc/latex/docassembly/examples/sounds/trek.wav new file mode 100644 index 00000000..b8d9e65d Binary files /dev/null and b/texmf-dist/doc/latex/docassembly/examples/sounds/trek.wav differ diff --git a/texmf-dist/doc/latex/docassembly/examples/watermark-file.tex b/texmf-dist/doc/latex/docassembly/examples/watermark-file.tex new file mode 100644 index 00000000..c7b9f10f --- /dev/null +++ b/texmf-dist/doc/latex/docassembly/examples/watermark-file.tex @@ -0,0 +1,25 @@ +\documentclass{article} +\usepackage{docassembly} +\usepackage{lipsum} + +\hypersetup{pdfpagemode=UseNone} + +% Look in the Adobe Acrobat JavaScript manual under the addWatermarkFromFile to see all the possible parameters. +\begin{docassembly} +\retnAbsPathAs(_path); +_path += "/graphics/AeB_Logo.pdf"; +\addWatermarkFromFile({ + bOnTop:false, + bOnPrint:false, + nOpacity: 0.2, + nRotation: 90, + cDIPath:_path +}); +\executeSave(); +\end{docassembly} + +\begin{document} + +\lipsum[1-30] + +\end{document} \ No newline at end of file diff --git a/texmf-dist/doc/latex/docassembly/examples/watermark-text.tex b/texmf-dist/doc/latex/docassembly/examples/watermark-text.tex new file mode 100644 index 00000000..4b4c123b --- /dev/null +++ b/texmf-dist/doc/latex/docassembly/examples/watermark-text.tex @@ -0,0 +1,26 @@ +\documentclass{article} +\usepackage{docassembly} +\usepackage{lipsum} + +\hypersetup{pdfpagemode=UseNone} + +% Look in the Adobe Acrobat JavaScript manual under the addWatermarkFromText to see all the possible parameters. +\begin{docassembly} +\addWatermarkFromText({ + cText: "Confidential", + aColor: color.red, + nFontSize: 72, + cFont:font.HelvB, + bOnTop:false, + bOnPrint:false, + nOpacity: 0.2, + nRotation: 45 +}); +\executeSave(); +\end{docassembly} + +\begin{document} + +\lipsum[1-30] + +\end{document} \ No newline at end of file -- cgit v1.2.3