{"id":5161,"date":"2017-12-21T23:40:09","date_gmt":"2017-12-21T22:40:09","guid":{"rendered":"http:\/\/archivista.ch\/cms\/?page_id=5161"},"modified":"2022-04-06T11:21:10","modified_gmt":"2022-04-06T09:21:10","slug":"date-stamps","status":"publish","type":"page","link":"https:\/\/archivista.ch\/cms\/en\/news\/2008-2019\/year-2017\/date-stamps\/","title":{"rendered":"Date Stamps"},"content":{"rendered":"<h1>ArchivistaBox 2017\/III: Inbox fully automated<\/h1>\n<p><em><strong>Egg, March 2017:<\/strong> With version 2017\/III the postmarking of incoming mail is available. If the date of the incoming mail was previously entered in the&#8216; Date&#8216; field, an automated sticky note can now be entered, which is automatically attached to the document. Whether it&#8217;s scanned documents or digital files, with the new stamp functions, incoming documents can be beautifully automated.<\/em><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/archivista.ch\/cms\/wp-content\/uploads\/image\/varazze1.jpg\" alt=\"\" \/><\/p>\n<h2>Postmark in three steps<\/h2>\n<p>Customers and prospective customers are sometimes amazed at how simple and elegant new functions can be implemented. This is no different with the new postmark.<\/p>\n<h3>Step 1: Create script<\/h3>\n<p>Thanks to the fully integrated scripting capability of ArchivistaDMS, all you need is a small script to apply input stamps:<\/p>\n<pre><strong><span style=\"font-size: 12px;\"><span style=\"font-family: comic sans ms,cursive;\">#!\/usr\/bin\/perl<\/span><\/span><\/strong>\r\n<strong><span style=\"font-size: 12px;\"><span style=\"font-family: comic sans ms,cursive;\">use strict;\r\nuse lib qw(\/home\/cvs\/archivista\/jobs);\r\nuse AVJobs;\r\nmy $host=shift;\r\nmy $db=shift;\r\nmy $user=shift;\r\nmy $pw=shift;\r\nmy $doc=shift;\r\nmy $note=\"3;92;141;521;432;0;0;1;1;255;16777215;2;6;0;18;1;0;0;0;\".\r\n  \"imgx;imgy;300;300;Arial;Eingang\";\r\nmy $date=DateStamp(time());\r\nmy $year=substr($date,8,2);\r\nmy $dbh=MySQLOpen();\r\nif ($dbh) {\r\n  if (!HostIsSlave($dbh)) {\r\n    $dbh-&gt;do(\"use $db\");\r\n    my $nr=($doc*1000)+1;\r\n    my $sql = \"select count(Seite) from archivbilder where Seite=$nr\";\r\n    my @row = $dbh-&gt;selectrow_array($sql);\r\n    if ($row[0]&gt;0) {\r\n      $sql = \"select Notes from archivseiten where Seite=$nr\";\r\n      my @row = $dbh-&gt;selectrow_array($sql);\r\n      if ($row[0] eq \"\") {\r\n        $sql = \"select BildInput from archivbilder where Seite=$nr\";\r\n        @row = $dbh-&gt;selectrow_array($sql);\r\n        if (length($row[0])&gt;0) {\r\n          my $imgo = ExactImage::newImage();\r\n          ExactImage::decodeImage($imgo,$row[0]);\r\n          my $width = ExactImage::imageWidth($imgo);\r\n          my $height = ExactImage::imageHeight($imgo);\r\n          if ($width&gt;0 &amp;&amp; $height&gt;0) {\r\n            $note =~ s\/imgx\/$width\/g;\r\n            $note =~ s\/imgy\/$height\/g;\r\n            $sql = \"show tables like 'stamp$year'\";\r\n            @row = $dbh-&gt;selectrow_array($sql);\r\n            if ($row[0] eq \"\") {\r\n              $sql = \"create table stamp$year \".\r\n                \"(id int(11) primary key auto_increment,Laufnummer int(11))\";\r\n              $dbh-&gt;do($sql);\r\n            }\r\n            $sql = \"insert into stamp$year set Laufnummer=$doc\";\r\n            $dbh-&gt;do($sql);\r\n            $sql = \"select id from stamp$year where Laufnummer=$doc\";\r\n            @row = $dbh-&gt;selectrow_array($sql);\r\n            my $count = $row[0];\r\n            if ($count&gt;0 &amp;&amp; $count&lt;=9999) {\r\n              my $countnew = ($year*10000)+$count;\r\n              my $note1 = $note.\" \".DateStamp(time()).\" \".$countnew;\r\n              my $seite = ($doc*1000)+1;\r\n              $sql = \"update archivseiten set Notes='$note1' where \".\r\n                \"Seite=$seite\";\r\n              $dbh-&gt;do($sql);\r\n              $sql = \"update archiv set intRechnungNr='$countnew',\".\r\n                \"DokTyp='Eingangsrechnung' where Laufnummer=$doc\";\r\n              $dbh-&gt;do($sql);\r\n} }  }  }  }  }  }\r\n<\/span><\/span><\/strong><\/pre>\n<h3><strong>Step 2: Capture Script in WebAdmin<br \/>\n<\/strong><\/h3>\n<p>Now we add this script in WebAdmin under&#8216; Administer jobs&#8216; and the following screen:<\/p>\n<p><a href=\"https:\/\/archivista.ch\/cms\/wp-content\/uploads\/2017\/12\/postmark.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5164\" src=\"https:\/\/archivista.ch\/cms\/wp-content\/uploads\/2017\/12\/postmark.png\" width=\"600\" height=\"464\" srcset=\"https:\/\/archivista.ch\/cms\/wp-content\/uploads\/2017\/12\/postmark.png 1001w, https:\/\/archivista.ch\/cms\/wp-content\/uploads\/2017\/12\/postmark-300x232.png 300w, https:\/\/archivista.ch\/cms\/wp-content\/uploads\/2017\/12\/postmark-768x594.png 768w, https:\/\/archivista.ch\/cms\/wp-content\/uploads\/2017\/12\/postmark-600x464.png 600w, https:\/\/archivista.ch\/cms\/wp-content\/uploads\/2017\/12\/postmark-624x482.png 624w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>Note that scripts can only be stored after&#8216; \/home\/data\/archivista\/cust\/autofields&#8216;. In addition, a valid username and password must be specified so that the script can be copied to the desired folder. The option&#8216; Update activated&#8216; as well as a valid user name and the corresponding password must also be entered in the same way as above.<\/p>\n<p>Now you have to enter the script in WebAdmin under&#8216; Scan&#8216; in the desired scan definitions under&#8216; Default fields&#8216;, this time of course without the path (concretely only&#8216; stamp. pl&#8216;).<\/p>\n<h3>Step 3: Process files<\/h3>\n<p>As soon as a file or scanned pages with the desired scan definition are processed, the script is automatically executed in the background every time.<\/p>\n<p>As a result, the desired stamp is applied to the document:<\/p>\n<p><a href=\"https:\/\/archivista.ch\/cms\/wp-content\/uploads\/2017\/12\/postmark2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5165\" src=\"https:\/\/archivista.ch\/cms\/wp-content\/uploads\/2017\/12\/postmark2.png\" alt=\"\" width=\"1685\" height=\"581\" srcset=\"https:\/\/archivista.ch\/cms\/wp-content\/uploads\/2017\/12\/postmark2.png 1685w, https:\/\/archivista.ch\/cms\/wp-content\/uploads\/2017\/12\/postmark2-300x103.png 300w, https:\/\/archivista.ch\/cms\/wp-content\/uploads\/2017\/12\/postmark2-768x265.png 768w, https:\/\/archivista.ch\/cms\/wp-content\/uploads\/2017\/12\/postmark2-1024x353.png 1024w, https:\/\/archivista.ch\/cms\/wp-content\/uploads\/2017\/12\/postmark2-600x207.png 600w, https:\/\/archivista.ch\/cms\/wp-content\/uploads\/2017\/12\/postmark2-624x215.png 624w\" sizes=\"auto, (max-width: 1685px) 100vw, 1685px\" \/><\/a><\/p>\n<p>This activates the automatic stamp on inbox. In contrast to normal sticky notes, the stamp can be moved, but not deleted.<\/p>\n<h2>Conclusion: Automation made easy<\/h2>\n<p>The stamping solution presented here has been in use by customers for several months. In this case, the sticky notes had to be extended in such a way that sticky notes cannot be deleted automatically. This means that the ArchivistaBox 2017\/I is absolutely essential.<\/p>\n<p>The present solution is also a good example of how easy (and elegant) the ArchivistaBox can be extended. This doesn&#8217;t have to be done with Perl (as above) because the ArchivistaBox offers not only Perl but also the scripting languages PHP and Python.<\/p>\n<p>It goes without saying that no one has to&#8216; scripts&#8216; themselves (but may, of course), a contact and an appointment is sufficient for the solution to be realized for you.<\/p>\n<p><strong>Finally, a tip:<\/strong> The stamps will also appear on the exported PDF files, but not if you click on&#8216; PIC&#8216; or&#8216; IMG&#8216; in the table view, in the latter two options the rasterized original data will be provided, i. e. the processed archive data will not be&#8216; damaged&#8216; by the stamps. In contrast, the stamps in PDF files are&#8216; rasterized&#8216; into the image data, i. e. in PDF files the stamps cannot be changed (even moved).<\/p>\n\n\n\n\t<div class=\"dkpdf-button-container\" style=\"            text-align:right \">\n\n\t\t<a class=\"dkpdf-button\" href=\"\/cms\/wp-json\/wp\/v2\/pages\/5161?pdf=5161\" target=\"_blank\"><span class=\"dkpdf-button-icon\"><i class=\"fa fa-file-pdf-o\"><\/i><\/span> PDF Button<\/a>\n\n\t<\/div>\n\n\n\n\n\n","protected":false},"excerpt":{"rendered":"<p>ArchivistaBox 2017\/III: Inbox fully automated Egg, March 2017: With version 2017\/III the postmarking of incoming mail is available. If the date of the incoming mail was previously entered in the&#8216; Date&#8216; field, an automated sticky note can now be entered, which is automatically attached to the document. Whether it&#8217;s scanned documents or digital files, with [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":5156,"menu_order":198,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-5161","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/archivista.ch\/cms\/wp-json\/wp\/v2\/pages\/5161","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/archivista.ch\/cms\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/archivista.ch\/cms\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/archivista.ch\/cms\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/archivista.ch\/cms\/wp-json\/wp\/v2\/comments?post=5161"}],"version-history":[{"count":5,"href":"https:\/\/archivista.ch\/cms\/wp-json\/wp\/v2\/pages\/5161\/revisions"}],"predecessor-version":[{"id":9388,"href":"https:\/\/archivista.ch\/cms\/wp-json\/wp\/v2\/pages\/5161\/revisions\/9388"}],"up":[{"embeddable":true,"href":"https:\/\/archivista.ch\/cms\/wp-json\/wp\/v2\/pages\/5156"}],"wp:attachment":[{"href":"https:\/\/archivista.ch\/cms\/wp-json\/wp\/v2\/media?parent=5161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}