<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; HTA: Печать без вывода диалога]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=8293</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=8293&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «HTA: Печать без вывода диалога».]]></description>
		<lastBuildDate>Thu, 30 May 2013 17:29:25 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: HTA: Печать без вывода диалога]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=72578#p72578</link>
			<description><![CDATA[<p>2<strong>Mat Skywalker</strong><br />Ну если Вы решили действовать по моей гнилой методе, то способа - 2:<br />1. Добавить еще несколько SendKeys которые переместят курсор на поле с количеством копий и забьют их количество до нажатия Enter.<br />2. Поручить это дело скрипту на AutoIt (он выполнит это дело более надежно).<br />Оба варианта не универсальны, т.к. диалог печати может выглядеть по разному.</p>]]></description>
			<author><![CDATA[null@example.com (mozers)]]></author>
			<pubDate>Thu, 30 May 2013 17:29:25 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=72578#p72578</guid>
		</item>
		<item>
			<title><![CDATA[Re: HTA: Печать без вывода диалога]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=72500#p72500</link>
			<description><![CDATA[<p>В продолжение темы. Как указать количество копий документа?</p>]]></description>
			<author><![CDATA[null@example.com (Mat Skywalker)]]></author>
			<pubDate>Tue, 28 May 2013 11:00:08 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=72500#p72500</guid>
		</item>
		<item>
			<title><![CDATA[Re: HTA: Печать без вывода диалога]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=72124#p72124</link>
			<description><![CDATA[<div class="quotebox"><cite>mozers пишет:</cite><blockquote><p>Спасибо</p></blockquote></div><p>Пришлось воспользоваться вашим советом.</p>]]></description>
			<author><![CDATA[null@example.com (Mat Skywalker)]]></author>
			<pubDate>Tue, 14 May 2013 23:29:43 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=72124#p72124</guid>
		</item>
		<item>
			<title><![CDATA[Re: HTA: Печать без вывода диалога]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=72041#p72041</link>
			<description><![CDATA[<p>2<strong>Mat Skywalker</strong><br />В свое время я, изрядно помучившись с ExecWB, пришел к такому простенькому решению:</p><div class="codebox"><pre><code>setTimeout(&#039;with(new ActiveXObject(&quot;WScript.Shell&quot;)){SendKeys(&quot;{ENTER}&quot;)}&#039;, 2000);
window.print();</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (mozers)]]></author>
			<pubDate>Sun, 12 May 2013 12:50:15 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=72041#p72041</guid>
		</item>
		<item>
			<title><![CDATA[Re: HTA: Печать без вывода диалога]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=72033#p72033</link>
			<description><![CDATA[<p>Может через Word попробовать?</p>]]></description>
			<author><![CDATA[null@example.com (JSmаn)]]></author>
			<pubDate>Sat, 11 May 2013 22:25:15 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=72033#p72033</guid>
		</item>
		<item>
			<title><![CDATA[Re: HTA: Печать без вывода диалога]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=71998#p71998</link>
			<description><![CDATA[<div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><p>Добавьте хотя бы:<br /></p><div class="codebox"><pre><code>&lt;meta charset=&quot;windows-1251&quot;&gt;</code></pre></div></div></div><p>Должно бы работать это: <a href="http://www.script-coding.com/WSH/WebBrowser.html#3.1.">WebBrowser: 3.1. Метод ExecWB</a>, как показано в :<a href="http://stackoverflow.com/questions/21908/silent-printing-in-a-web-application">internet - &quot;Silent&quot; Printing in a Web Application - Stack Overflow</a>. Но у меня не сработало:<br /></p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><div class="codebox"><pre><code>---------------------------
Ошибка
---------------------------
Во время выполнения произошла ошибка.
Запустить отладку?

Строка: 80
Ошибка: Данная команда не поддерживается.
</code></pre></div></div></div>]]></description>
			<author><![CDATA[null@example.com (alexii)]]></author>
			<pubDate>Thu, 09 May 2013 21:58:10 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=71998#p71998</guid>
		</item>
		<item>
			<title><![CDATA[HTA: Печать без вывода диалога]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=71996#p71996</link>
			<description><![CDATA[<p>Есть вот такой HTA файл, который создает штрих-коды. Как отправить его на печать без диалога выбора принтера?<br /></p><div class="codebox"><pre><code>
&lt;html&gt;
&lt;hta:application id=&quot;bar_gen&quot; 
applicationname=&quot;Print bcodes&quot;
contextmenu=&quot;yes&quot;
innerborder=&quot;no&quot;
maximizebutton=&quot;no&quot;
minimizebutton=&quot;yes&quot;
selection=&quot;no&quot;
showintaskbar=&quot;yes&quot;
singleinstance=&quot;yes&quot;
sysmenu=&quot;yes&quot;
SCROLL=&quot;no&quot;
windowstate=&quot;normal&quot;
ICON=&quot;cypher.ico&quot;
&gt;
  &lt;head&gt;
  &lt;title&gt;Генератор штрихкодов.&lt;/title&gt;
    &lt;style&gt;
      * {
          color:#000000;
          font-family:Arial,sans-serif;
          font-size:12px;
          font-weight:normal;
      }    
      #config{
          overflow: auto;
          margin-bottom: 10px;
      }
      .config{
          float: left;
          width: 200px;
          height: 250px;
          border: 1px solid #000;
          margin-left: 10px;
      }
      .config .title{
          font-weight: bold;
          text-align: center;
      }
      .config .barcode2D,
      #miscCanvas{
        display: none;
      }
      #submit{
          clear: both;
      }
      #barcodeTarget,
      #canvasTarget{
        margin-top: 1px;
      }        
    &lt;/style&gt;
&lt;style type=&quot;text/css&quot; media=&quot;print&quot;&gt; 
   div.config {display: none; } 
   div.generator {display: none; } 
   div.submit {display: none; } 
   div.barcodeTarget {display: block; } 
   input  {display: none; } 
    button  {display: none; } 
    barcodeValue {display: none; } 
    generator {display: none; } 
    no_print {display: none; } 
 &lt;/style&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;jquery-1.3.2.min.js&quot;&gt;&lt;/script&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;jquery-barcode-2.0.2.min.js&quot;&gt;&lt;/script&gt;
    &lt;script type=&quot;text/javascript&quot;&gt;
     self.resizeTo(670,200);

                    function goooo(){
                        window.print();
                        return( false );
                    }
      function generateBarcode(){
        var value = $(&quot;#barcodeValue&quot;).val();
        var btype = $(&quot;input[name=btype]:checked&quot;).val();
        var renderer = $(&quot;input[name=renderer]:checked&quot;).val();
        
        var quietZone = false;
        if ($(&quot;#quietzone&quot;).is(&#039;:checked&#039;) || $(&quot;#quietzone&quot;).attr(&#039;checked&#039;)){
          quietZone = true;
        }
        
        var settings = {
          output:renderer,
          bgColor: $(&quot;#bgColor&quot;).val(),
          color: $(&quot;#color&quot;).val(),
          barWidth: $(&quot;#barWidth&quot;).val(),
          barHeight: $(&quot;#barHeight&quot;).val(),
          moduleSize: $(&quot;#moduleSize&quot;).val(),
          posX: $(&quot;#posX&quot;).val(),
          posY: $(&quot;#posY&quot;).val(),
          addQuietZone: $(&quot;#quietZoneSize&quot;).val()
        };
        if ($(&quot;#rectangular&quot;).is(&#039;:checked&#039;) || $(&quot;#rectangular&quot;).attr(&#039;checked&#039;)){
          value = {code:value, rect: true};
        }
        if (renderer == &#039;canvas&#039;){
          clearCanvas();
          $(&quot;#barcodeTarget&quot;).hide();
          $(&quot;#canvasTarget&quot;).show().barcode(value, btype, settings);
        } else {
          $(&quot;#canvasTarget&quot;).hide();
          $(&quot;#barcodeTarget&quot;).html(&quot;&quot;).show().barcode(value, btype, settings);
        }
      }
          
      function showConfig1D(){
        $(&#039;.config .barcode1D&#039;).show();
        $(&#039;.config .barcode2D&#039;).hide();
      }
      
      function showConfig2D(){
        $(&#039;.config .barcode1D&#039;).hide();
        $(&#039;.config .barcode2D&#039;).show();
      }
      
      function clearCanvas(){
        var canvas = $(&#039;#canvasTarget&#039;).get(0);
        var ctx = canvas.getContext(&#039;2d&#039;);
        ctx.lineWidth = 1;
        ctx.lineCap = &#039;butt&#039;;
        ctx.fillStyle = &#039;#FFFFFF&#039;;
        ctx.strokeStyle  = &#039;#000000&#039;;
        ctx.clearRect (0, 0, canvas.width, canvas.height);
        ctx.strokeRect (0, 0, canvas.width, canvas.height);
      }
      
      $(function(){
        $(&#039;input[name=btype]&#039;).click(function(){
          if ($(this).attr(&#039;id&#039;) == &#039;datamatrix&#039;) showConfig2D(); else showConfig1D();
        });
        $(&#039;input[name=renderer]&#039;).click(function(){
          if ($(this).attr(&#039;id&#039;) == &#039;canvas&#039;) $(&#039;#miscCanvas&#039;).show(); else $(&#039;#miscCanvas&#039;).hide();
        });
        generateBarcode();
      });
  
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body style=&quot;margin: 0px&quot;&gt;
    &lt;div id=&quot;generator&quot;&gt;
    &lt;div class=&quot;generator&quot;&gt;&lt;br&gt;&lt;center&gt;
      &amp;nbsp;&amp;nbsp;Цифры кода : &lt;input type=&quot;text&quot; id=&quot;barcodeValue&quot; value=&quot;4600452017135&quot;&gt;&lt;/center&gt;&lt;/div&gt;&lt;br&gt;
      &lt;div id=&quot;config&quot;&gt;
        &lt;div class=&quot;config&quot; style=&quot;display: none&quot;&gt;
          &lt;div class=&quot;title&quot;&gt;Тип кода&lt;/div&gt;      
          &lt;input type=&quot;radio&quot; name=&quot;btype&quot; id=&quot;ean13&quot; value=&quot;ean13&quot; checked=&quot;checked&quot;&gt;&lt;label for=&quot;ean13&quot;&gt;EAN 13&lt;/label&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
        &lt;/div&gt;
            
        &lt;div class=&quot;config&quot; style=&quot;display: none&quot;&gt;
          &lt;div class=&quot;title&quot;&gt;Настройки&lt;/div&gt;
             &amp;nbsp;Цвет фона : &lt;input type=&quot;text&quot; id=&quot;bgColor&quot; value=&quot;#FFFFFF&quot; size=&quot;7&quot;&gt;&lt;br /&gt;
            &amp;nbsp;Цвет полосок : &lt;input type=&quot;text&quot; id=&quot;color&quot; value=&quot;#000000&quot; size=&quot;7&quot;&gt;&lt;br /&gt;
          &lt;div class=&quot;barcode1D&quot;&gt;
             &amp;nbsp;Ширина: &lt;input type=&quot;text&quot; id=&quot;barWidth&quot; value=&quot;1&quot; size=&quot;3&quot;&gt;&lt;br /&gt;
             &amp;nbsp;Высота: &lt;input type=&quot;text&quot; id=&quot;barHeight&quot; value=&quot;20&quot; size=&quot;3&quot;&gt;&lt;br /&gt;
          &lt;/div&gt;
          &lt;div class=&quot;barcode2D&quot;&gt;
            &amp;nbsp;Размер: &lt;input type=&quot;text&quot; id=&quot;moduleSize&quot; value=&quot;10&quot; size=&quot;3&quot;&gt;&lt;br /&gt;
            &amp;nbsp;Размер Quiet Zone: &lt;input type=&quot;text&quot; id=&quot;quietZoneSize&quot; value=&quot;10&quot; size=&quot;3&quot;&gt;&lt;br /&gt;
            &amp;nbsp;Форма: &lt;input type=&quot;checkbox&quot; name=&quot;rectangular&quot; id=&quot;rectangular&quot;&gt;&lt;label for=&quot;rectangular&quot;&gt;Rectangular&lt;/label&gt;&lt;br /&gt;
          &lt;/div&gt;
          &lt;div id=&quot;miscCanvas&quot;&gt;
            x : &lt;input type=&quot;text&quot; id=&quot;posX&quot; value=&quot;10&quot; size=&quot;3&quot;&gt;&lt;br /&gt;
            y : &lt;input type=&quot;text&quot; id=&quot;posY&quot; value=&quot;20&quot; size=&quot;3&quot;&gt;&lt;br /&gt;
          &lt;/div&gt;
        &lt;/div&gt;
            
        &lt;div class=&quot;config&quot; style=&quot;display: none&quot;&gt;
          &lt;div class=&quot;title&quot;&gt;Печать&lt;/div&gt;
          &lt;input type=&quot;radio&quot; id=&quot;css&quot; name=&quot;renderer&quot; value=&quot;css&quot; checked=&quot;checked&quot;&gt;&lt;label for=&quot;css&quot;&gt;CSS&lt;/label&gt;&lt;br /&gt;
         &lt;input type=&quot;button&quot; onclick=&quot;goooo();&quot; value=&quot;&amp;nbsp;Печать штрихкода&amp;nbsp;&quot;&gt;
        &lt;/div&gt;
      &lt;/div&gt;
        
      &lt;div id=&quot;submit&quot;&gt;
       &lt;br&gt;&lt;center&gt;&lt;b&gt;&lt;input type=&quot;button&quot; onclick=&quot;generateBarcode();&quot; value=&quot;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Генерация штрихкода&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;&gt;&lt;/b&gt;&lt;center&gt;
        
      &lt;/div&gt;
        &lt;br&gt;
    &lt;/div&gt;
    &lt;span id=&quot;B_text&quot; style=&quot;font-size: 7px;  font-family: Verdana;&quot;&gt;&lt;/span&gt;
    &lt;div id=&quot;barcodeTarget&quot; class=&quot;barcodeTarget&quot;&gt;&lt;br&gt;&lt;/div&gt;
    &lt;canvas id=&quot;canvasTarget&quot; width=&quot;150&quot; height=&quot;150&quot;&gt;&lt;/canvas&gt; 
  &lt;/body&gt;
&lt;/html&gt;
</code></pre></div><p>Пробовал InternetExplorer.Application - не получилось ничего. Какие еще есть ходы?</p>]]></description>
			<author><![CDATA[null@example.com (Mat Skywalker)]]></author>
			<pubDate>Thu, 09 May 2013 17:21:32 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=71996#p71996</guid>
		</item>
	</channel>
</rss>
