<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Drucker druckt zu klein]]></title><description><![CDATA[<p>Hallo,</p>
<p>Ich habe folgendes Problem:<br />
Ich versuche einen Text zu drucken, was auch bisher wunderbar funktioniert hat.<br />
Aber auf manchen Druckern ist der Text so klein dass man ihn nicht mehr lesen kann. Kann mir jemand sagen was man dagegen tun kann.</p>
<p>Ich hab mal vermutet das der DEVMODE eventuell durch den DruckDialog verändert wird und hab die einzelnen Variablen auch mal verglichen jedoch ohne unterschiede.</p>
<p>Hier der verwendete Quellcode</p>
<pre><code class="language-cpp">CPrintDialog dlgPrint(FALSE, PD_ALLPAGES, this);
    CPrintInfo pInfo;

    if (dlgPrint.DoModal() == IDCANCEL)
    {
        return;
    }

    /*if(!dlgPrint.GetDefaults())
		AfxMessageBox(_T(&quot;Bitte richten Sie einen Standarddrucker ein&quot;));*/
    CDC dcPrint;
    dcPrint.Attach(dlgPrint.GetPrinterDC());

    // Quer-Format
    /*DEVMODE* myMode = dlgPrint.GetDevMode();
    myMode-&gt;dmOrientation	= DMORIENT_LANDSCAPE;
	myMode-&gt;dmColor			= DMCOLOR_COLOR;
	dcPrint.ResetDC(myMode);*/
    DOCINFO myPrintJob;
    myPrintJob.cbSize		= sizeof(myPrintJob);
    myPrintJob.lpszDocName	= _T(&quot;Name&quot;);
    myPrintJob.lpszOutput	= NULL;
    myPrintJob.lpszDatatype = NULL;
    myPrintJob.fwType		= NULL;

    int x = GetDeviceCaps(dlgPrint.GetPrinterDC(), PHYSICALOFFSETX);
    int y = GetDeviceCaps(dlgPrint.GetPrinterDC(), PHYSICALOFFSETY);

    if (dcPrint.StartDoc(&amp;myPrintJob) &gt;= 0)
    {
        dcPrint.StartPage();

        CString str = _T(&quot;Test Test Test&quot;);
        for (int i = 0; i &lt; 10; i++)
        {
			dcPrint.DrawText((250 - x, 250 - y + i * 100, str, str.GetLength());
        }

        dcPrint.EndPage();
        dcPrint.EndDoc();
    }
</code></pre>
<p>Vielen Dank<br />
gruß Raffzen</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/159848/drucker-druckt-zu-klein</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Jul 2026 11:19:58 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/159848.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 19 Sep 2006 14:09:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Drucker druckt zu klein on Tue, 19 Sep 2006 14:09:08 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Ich habe folgendes Problem:<br />
Ich versuche einen Text zu drucken, was auch bisher wunderbar funktioniert hat.<br />
Aber auf manchen Druckern ist der Text so klein dass man ihn nicht mehr lesen kann. Kann mir jemand sagen was man dagegen tun kann.</p>
<p>Ich hab mal vermutet das der DEVMODE eventuell durch den DruckDialog verändert wird und hab die einzelnen Variablen auch mal verglichen jedoch ohne unterschiede.</p>
<p>Hier der verwendete Quellcode</p>
<pre><code class="language-cpp">CPrintDialog dlgPrint(FALSE, PD_ALLPAGES, this);
    CPrintInfo pInfo;

    if (dlgPrint.DoModal() == IDCANCEL)
    {
        return;
    }

    /*if(!dlgPrint.GetDefaults())
		AfxMessageBox(_T(&quot;Bitte richten Sie einen Standarddrucker ein&quot;));*/
    CDC dcPrint;
    dcPrint.Attach(dlgPrint.GetPrinterDC());

    // Quer-Format
    /*DEVMODE* myMode = dlgPrint.GetDevMode();
    myMode-&gt;dmOrientation	= DMORIENT_LANDSCAPE;
	myMode-&gt;dmColor			= DMCOLOR_COLOR;
	dcPrint.ResetDC(myMode);*/
    DOCINFO myPrintJob;
    myPrintJob.cbSize		= sizeof(myPrintJob);
    myPrintJob.lpszDocName	= _T(&quot;Name&quot;);
    myPrintJob.lpszOutput	= NULL;
    myPrintJob.lpszDatatype = NULL;
    myPrintJob.fwType		= NULL;

    int x = GetDeviceCaps(dlgPrint.GetPrinterDC(), PHYSICALOFFSETX);
    int y = GetDeviceCaps(dlgPrint.GetPrinterDC(), PHYSICALOFFSETY);

    if (dcPrint.StartDoc(&amp;myPrintJob) &gt;= 0)
    {
        dcPrint.StartPage();

        CString str = _T(&quot;Test Test Test&quot;);
        for (int i = 0; i &lt; 10; i++)
        {
			dcPrint.DrawText((250 - x, 250 - y + i * 100, str, str.GetLength());
        }

        dcPrint.EndPage();
        dcPrint.EndDoc();
    }
</code></pre>
<p>Vielen Dank<br />
gruß Raffzen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1140433</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1140433</guid><dc:creator><![CDATA[_Raffzen]]></dc:creator><pubDate>Tue, 19 Sep 2006 14:09:08 GMT</pubDate></item><item><title><![CDATA[Reply to Drucker druckt zu klein on Tue, 19 Sep 2006 14:18:58 GMT]]></title><description><![CDATA[<p>Klingt nach Problemen mit dem Abbildungsmodus? Das Drucken erfolgt doch auflösungsabhängig. So ist das ja zumindest bei allen Zeichenoperationen. Weiß nur nicht ob das auch auf den Text zutrifft. Es könnte ja sein das ein Drucker mit hoher Auflösung den Text kleiner ausgibt als ein Drucker, dessen Auflösung nicht so hoch ist. Kannst Du da was feststellen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1140450</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1140450</guid><dc:creator><![CDATA[AndyDD]]></dc:creator><pubDate>Tue, 19 Sep 2006 14:18:58 GMT</pubDate></item><item><title><![CDATA[Reply to Drucker druckt zu klein on Thu, 21 Sep 2006 07:57:21 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">m_pDC-&gt;SetMapMode (MM_TEXT);
</code></pre>
<p>Mit Fonts arbeiten??</p>
<pre><code class="language-cpp">CFont myFont;
LOGFONT lf;
// lf füllen
myFont.CreateFontIndirect (&amp;lf);
pDC-&gt;SelectObject (&amp;myFont);
</code></pre>
<p>und DrawText mit den richtigen Parametern aufrufen, oder TextOut mit deinen Parametern aufrufen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1141597</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1141597</guid><dc:creator><![CDATA[electron]]></dc:creator><pubDate>Thu, 21 Sep 2006 07:57:21 GMT</pubDate></item><item><title><![CDATA[Reply to Drucker druckt zu klein on Fri, 22 Sep 2006 08:23:30 GMT]]></title><description><![CDATA[<p>Danke für den Hinweis</p>
<p>Das mit dem Font setzen war schon der richtige WEg. Aber bei Druckern mit verschiedener DPI wird das ganze wieder etwas verzerrt gedruckt.</p>
<p>Da das Positionieren über Pixel beim TextOut läudt sind 100 Pixel bei 300 DPi mehr als bei 600 DPI.</p>
<p>Aber so funktioniert es wunder bar</p>
<p>Auszug aus meiner klasse:</p>
<pre><code class="language-cpp">CFont cFont;
    int nDPI = m_pDC-&gt;GetDeviceCaps(LOGPIXELSY);
    m_nPixelHeight = MulDiv(12, m_pDC-&gt;GetDeviceCaps(LOGPIXELSY), 72);
    m_uiPixelDiffLine = m_nPixelHeight / 10;
    cFont.CreateFont(-m_nPixelHeight,
                     0,
                     0,
                     0,
                     400,
                     0,
                     0,
                     0,
                     DEFAULT_CHARSET,
                     OUT_CHARACTER_PRECIS,
                     CLIP_CHARACTER_PRECIS,
                     PROOF_QUALITY,
                     DEFAULT_PITCH | FF_DONTCARE,
                     strFont);

    m_pDC-&gt;SelectObject(&amp;cFont);
    m_pDC-&gt;SetMapMode(MM_TEXT);

    // Pixel berechnen 1Inch = 25.4 Millimeter
    m_xPos = GetDeviceCaps(dlgPrint.GetPrinterDC(), PHYSICALOFFSETX);
    m_yPos = GetDeviceCaps(dlgPrint.GetPrinterDC(), PHYSICALOFFSETY);

    m_xOffset = fn_GetPixel(nDPI, uiXOffset);
    m_yOffset = fn_GetPixel(nDPI, uiYOffset);
</code></pre>
<p>So werd ich mal um die Bitmaps kümmern</p>
<p>Vielen Dank nochmal<br />
Raffzen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1142364</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1142364</guid><dc:creator><![CDATA[_Raffzen]]></dc:creator><pubDate>Fri, 22 Sep 2006 08:23:30 GMT</pubDate></item><item><title><![CDATA[Reply to Drucker druckt zu klein on Fri, 22 Sep 2006 08:41:09 GMT]]></title><description><![CDATA[<p>Hab zwar noch nicht so viel mit Druckern gemacht, aber wäre es vielleicht auch denkbar, einen frei skalierbaren Abbildungsmodus zu nehmen und die Größe des Druckbereiches vom Drucker abfragen. Daraus lässt sich doch ein Skalierfaktor errechnen, der dann wierderum beim Create() des Fonts die Schriftgröße beinflusst.<br />
Im Grunde machst Du ja auch nichts anderes. Allerdings lässt Du den Abbildungsmodus auf MM_TEXT. Solltest Du andere GDI-Objekte ausgeben müssen wirst Du wohl nicht drum rum kommen das so zu machen. Bei mir funktionierts zumindest für den Screen und dürfte dann auch für den Drucker gehen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1142379</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1142379</guid><dc:creator><![CDATA[AndyDD]]></dc:creator><pubDate>Fri, 22 Sep 2006 08:41:09 GMT</pubDate></item><item><title><![CDATA[Reply to Drucker druckt zu klein on Mon, 25 Sep 2006 08:58:58 GMT]]></title><description><![CDATA[<p>Also bisher funktionierts tadellos.</p>
<p>Ich hab jetzt ein neues Problem:<br />
Wenn ich im Text ein Tab (\t) hab dann werden für die Tabs nur so komische Rechtecke gedruckt. Was kann man dagegen tun??</p>
<p>Gruß Raffzen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1143841</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1143841</guid><dc:creator><![CDATA[_Raffzen]]></dc:creator><pubDate>Mon, 25 Sep 2006 08:58:58 GMT</pubDate></item><item><title><![CDATA[Reply to Drucker druckt zu klein on Mon, 25 Sep 2006 09:24:32 GMT]]></title><description><![CDATA[<p>_Raffzen schrieb:</p>
<blockquote>
<p>Also bisher funktionierts tadellos.</p>
<p>Ich hab jetzt ein neues Problem:<br />
Wenn ich im Text ein Tab (\t) hab dann werden für die Tabs nur so komische Rechtecke gedruckt. Was kann man dagegen tun??</p>
<p>Gruß Raffzen</p>
</blockquote>
<p>Druckst Du mit Unicode-Strings?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1143866</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1143866</guid><dc:creator><![CDATA[AndyDD]]></dc:creator><pubDate>Mon, 25 Sep 2006 09:24:32 GMT</pubDate></item><item><title><![CDATA[Reply to Drucker druckt zu klein on Mon, 25 Sep 2006 09:30:34 GMT]]></title><description><![CDATA[<p>Ja</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1143869</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1143869</guid><dc:creator><![CDATA[_Raffzen]]></dc:creator><pubDate>Mon, 25 Sep 2006 09:30:34 GMT</pubDate></item></channel></rss>