Matroids Matheplanet Forum Index
Moderiert von Bilbo matph
Informatik » Sonstiges zur Informatik » Adobe Reader: PDF-Formular (hyperref) per Button um Unterschrift ergänzen
Autor
Kein bestimmter Bereich Adobe Reader: PDF-Formular (hyperref) per Button um Unterschrift ergänzen
Ex_Senior
  Themenstart: 2016-02-07

Gelegentlich benötigt man in einem Formular eine eingescannte Unterschrift. Ziel: Im PDF-Dokument Button erzeugen, der eine Graphikdatei (png, jpg,...) mit Unterschrift einfügt. Kann ich diese Funktionalität [AdobeReader XI] via hyperref.sty als Button umsetzen? http://matheplanet.de/matheplanet/nuke/html/uploads/9/477_84_55555555.png http://matheplanet.de/matheplanet/nuke/html/uploads/9/477_142_9999999999.jpg \sourceon latex \documentclass[parskip=half, paper=a4,]{scrreprt} \pagestyle{empty} \usepackage{selinput} \SelectInputMappings{adieresis={ä}, germandbls={ß}} \usepackage[ngerman]{babel} \usepackage[margin=1.0cm]{geometry} \usepackage{tabularx} \usepackage{mwe} \usepackage{xcolor} % \pagecolor{yellow!40} \usepackage{hyperref} % Textfelder % Style \renewcommand*{\DefaultOptionsofText}{print, bordercolor=red,borderstyle=U, backgroundcolor=lightgray!60} % % Inhalt \def\Name{\TextField[name=Nachname,width=5cm,]{Nachname:}% } \def\Vorname{\TextField[name=Vorname, width=5cm,value={}]{Vorname:}% } \def\Unterschrift{\TextField[name=Unterschrift, width=5cm, height=1.25cm, value={}]{Unterschrift:}% } \begin{document} %\lipsum[66] \begin{Form} \begin{tabularx}{0.9\textwidth}{ l c r } \textbf{Ausfüllbogen} & & \\[2ex] \Vorname & & \Name \\ \\ \Unterschrift & & \end{tabularx} \bigskip \Acrobatmenu{SaveAs}{\fcolorbox{black}{yellow}{PDF-Dokument speichern}} \end{Form} \end{document} \sourceoff Danke!


   Profil
emmi82
Senior Letzter Besuch: vor mehr als 3 Monaten
Dabei seit: 06.05.2013
Mitteilungen: 459
  Beitrag No.1, eingetragen 2016-02-07

Hi, evtl. hilft dir diese Übersicht oder digsig weiter. emmi


   Profil
Ex_Senior
  Beitrag No.2, vom Themenstarter, eingetragen 2016-02-08

Das Paket digsig \sourceon latex % \usepackage{digsig} \digsigfield{5cm}{3cm}{My signature} \sourceoff digsig.sty liefert im Resultat sowas: http://matheplanet.de/matheplanet/nuke/html/uploads/9/477_144_9999999999.jpg Wenn man sich durch die Menüs von Adobe Reader durchklickt, kann man damit sowas erstellen: http://matheplanet.de/matheplanet/nuke/html/uploads/9/477_145_9999999999.jpg Falls man eine graphische Handunterschrift als PDF-Datei hat, kann man auch diese noch (an der Stelle des Kreises) einfügen. Das ist für mein Problem zu umständlich - ich möchte lediglich eine Graphikdatei png/jpg/... in ein vorgegebenes Feld einfügen können, das allerdings per Button. So wie man es über die Menüs des Adobe Readers haben könnte: http://matheplanet.de/matheplanet/nuke/html/uploads/9/477_84_55555555.png \sourceon latex \documentclass[parskip=half, paper=a4,]{scrreprt} \pagestyle{empty} \usepackage{selinput} \SelectInputMappings{adieresis={ä}, germandbls={ß}} \usepackage[ngerman]{babel} \usepackage[margin=1.0cm]{geometry} \usepackage{tabularx} \usepackage{mwe} \usepackage{xcolor} % \pagecolor{yellow!40} \usepackage{ocg-p} % für nicht mitzudruckende Gruppen \usepackage{digsig} %\usepackage{eforms} \usepackage{hyperref} % Textfelder % Style \renewcommand*{\DefaultOptionsofText}{print, bordercolor=red,borderstyle=U, backgroundcolor=lightgray!60} % % Inhalt \def\Name{\TextField[name=Nachname,width=5cm,]{Nachname:}% } \def\Vorname{\TextField[name=Vorname, width=5cm,value={}]{Vorname:}% } \def\Unterschrift{\TextField[name=Unterschrift, width=5cm, height=1.25cm, value={}]{Unterschrift:}% } \begin{document} %\lipsum[66] \begin{Form} \begin{tabularx}{0.9\textwidth}{ l c r } \textbf{Ausfüllbogen} & & \\[2ex] \Vorname & & \Name \\ \\ \Unterschrift & & \end{tabularx} \bigskip \begin{ocg}[printocg=never]{SaveAsButton}{SaveAsButtonID}{1} \Acrobatmenu{SaveAs}{\fcolorbox{black}{yellow}{PDF-Dokument speichern}} \end{ocg} \digsigfield{5cm}{3cm}{My signature} \end{Form} \end{document} \sourceoff Ganzer Code \sourceon digsig.sty %****************************************************************************** % File: @(#)$OrigId: digsig.sty,v 1.16 2015-06-07 08:57:00+02 martin Rel $ % Contents: LaTeX macros for digital signature fields in PDF files % Author: Martin Lottermoser, Braunschweig, Germany; % Martin.Lottermoser at t-online.de % %****************************************************************************** % % Copyright (C) 2005-2015 by Martin Lottermoser % All rights reserved % %****************************************************************************** % % This package is an extension of the "hyperref" package and depends on % internal interfaces and other properties of that package which are not % documented and hence might change without notice. % % To use this package, proceed as follows: % - Include "\usepackage{digsig}" in your document. If it has not happened yet, % this call will also pull in the "hyperref" package. If you want to specify % options in the \usepackage call for "hyperref", include that package before % including "digsig". % - Call the macro \digsigfield to create one or more signature fields. The % macro's interface is specified below before its definition. % - The region of your file where you call \digsigfield should be contained in % hyperref's "Form" environment. % - For generating a PDF file, use either pdfTeX or configure hyperref for a % DVI driver (e.g., dvips) for which hyperref supports the \pdfmark command. % Using other configurations will not lead to signature fields; this package % will issue warnings in this case. % % To insert a signature in a signature field, you will also need suitable % software and, of course, a key. Note that Adobe's free Acrobat Reader is % capable of signing a signature field in a normal PDF file only since % version 11.0.7 (May 2014). % % % License % ======= % It cannot be applied exactly, but you should consider this file to be usable % in the spirit of the GNU Lesser General Public License, version 2.1 % (LGPLv2.1; see http://www.gnu.org/licenses/lgpl-2.1.html). Basically, I do % not claim to have any rights in the documents you create with this software, % you don't have to distribute my macros with your documents, but if you copy % or modify the macros and offer this derived version for distribution you have % to do this under the same license and it must be apparent what you have % copied or modified. % % If you have questions concerning this license, contact me for clarification. % %****************************************************************************** \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{digsig}[2015/06/07 Digital signature fields for PDF] %****************************************************************************** % No options \ProcessOptions %****************************************************************************** % We need the hyperref package. \RequirePackage{hyperref} %****************************************************************************** % Macro \digsigfield for creating a PDF signature field, similar in effect to % hyperref's \TextField etc. macros. Its arguments are: % #1: field width % #2: field height % #3: name of the field; may not contain periods ("."). This is not visible % in the printed representation but is usually displayed in a PDF viewer % capable of creating or verifying signatures. It depends on internals of % the "hyperref" package what happens if you use characters outside the % set of printable characters from ISO 646 (vulgo ASCII) or combining % control sequences like '\"'. My advice is to first ignore this % question, choose a sensible name encoded in your input encoding, and % then check the name displayed by your PDF reader. Change and repeat % until the result is more or less satisfactory :-). % From the point of view of TeX, the macro creates an empty box of the % specified extension with its reference point in the lower left corner. % Note that the macro does not change TeX's mode; if you want to enforce % horizontal mode for the environment the box is placed in, you will have to % take suitable steps yourself before calling the macro. % % Until it has been filled in, the field will only become visible in a PDF % viewer aware of signature fields. Signature-generating software will usually % create something to appear in the printed representation when you sign the % field. You can generate a signature field where the signature will not become % visible on the page by specifying a box of zero width and height. (This is % not as trivial as it sounds.) However, keep in mind that this field is only % invisible to the viewer; in terms of TeX, it's a box and may influence % formatting, in particular in the vertical modes. % % The following is an example of a call: % % \begin{Form} % \digsigfield{5cm}{2cm}{Author's signature} % \end{Form} % \newcommand*{\digsigfield}[3]{\hbox{% \pdfstringdef\Fld@name{#3}% \def\Fld@align{1}% Is this sensible? Do we need an option? \Fld@hiddenfalse \dimen255=#1\relax\ifdim\dimen255 < 2sp \dimen255=#2\relax\ifdim\dimen255 < 2sp \Fld@hiddentrue \fi\fi % No cheating with negative values! :-) \setbox0=\hbox{\rule{0mm}{#2}\kern#1}% % There has been an unfortunate (and in my opinion ill-considered) change % between pdftex 1.10b and pdfetex 1.21a: while \pdfstartlink/\pdfendlink % could formerly be called if \pdfoutput was zero, this is no longer % permitted in the newer versions. Hence the following is needed twice: \def\helper{\expandafter\ifx\csname pdfmark\endcsname\relax \box0\PackageWarningNoLine{digsig}{No pdfmark support in selected hyperref driver, hence no signature field ``\Fld@name''}% \else \pdfmark[\box0]{pdfmark=/ANN,Raw={\PDFFormExtension@Signature}}% \fi }% \expandafter\ifx\csname pdfoutput\endcsname\relax \helper \else\ifnum\pdfoutput > 0 \pdfstartlink user {\PDFFormExtension@Signature}\box0\pdfendlink \else \helper \fi\fi}} % Internal macro, similar to the \PDFForm@* macros of hyperref. The omission of % parameterization for "MK" is deliberate: if you need a border, create it with % TeX. \newcommand{\PDFFormExtension@Signature}{% /T (\Fld@name) /Subtype /Widget /FT /Sig /F \ifFld@hidden 2\else 4\fi\space /Q \Fld@align\space /MK << /BC [] >>} %****************************************************************************** % Record version information for this package if possible {\expandafter\ifx\csname sourceidentification\endcsname\relax\else \sourceidentification{\whatstring $OrigId: digsig.sty,v 1.16 2015-06-07 08:57:00+02 martin Rel $} \fi} %****************************************************************************** \endinput \sourceoff


   Profil
Ex_Senior hat die Antworten auf ihre/seine Frage gesehen.

Wechsel in ein anderes Forum:
 Suchen    
 
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © 2001-2022 by Matroids Matheplanet
This web site was originally made with PHP-Nuke, a former web portal system written in PHP that seems no longer to be maintained nor supported. PHP-Nuke is Free Software released under the GNU/GPL license.
Ich distanziere mich von rechtswidrigen oder anstößigen Inhalten, die sich trotz aufmerksamer Prüfung hinter hier verwendeten Links verbergen mögen.
Lesen Sie die Nutzungsbedingungen, die Distanzierung, die Datenschutzerklärung und das Impressum.
[Seitenanfang]