Jump to content
Sign in to follow this  


Recommended Posts


In the following code snippet the line: _PrintSetFont($hp,'Arial',18,0,'bold,underline')

sets the font. The 0 = black.

When trying other colors(1,2 ....) the result stays black; Why?

Is there a list of available colors?


#include 'printMGv2.au3'
Global $hp
Local $mmssgg,$marginx,$marginy
$hp = _PrintDllStart($mmssgg);this must always be called first
if $hp = 0 then
    consolewrite("Error from dllstart = " & $mmssgg & @CRLF)
$newselect = _PrintSetPrinter($hp)

_PrintSetDocTitle($hp,"This is a test page for PDFcreator No. 01")
$pght = _PrintGetpageheight($hp) - _PrintGetYOffset($hp)
$pgwd = _PrintGetpageWidth($hp) - _PrintGetXOffset($hp)

$Title = "This is a test of the printer dll"
$tw = _PrintGetTextWidth($hp,$Title)
$th = _PrintGetTextHeight($hp,$title)
_PrintText($hp,$title,Int($pgwd/2 - $tw/2),_PrintGetYOffset($hp))

For $n = 1 To 12
    _PrintText($hp,"This is color : " & $n-1,100,100+(70 * $n))


Share this post

Link to post
Share on other sites

Differences in color of only 1 or 2 in any single field ( R, G, or B ) are going to be very small and hard to detect with the naked eye. So it's not surprising that 0, 1, and 2 all look like the same black. Try larger differences to see the results.


Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post

Link to post
Share on other sites

try using "0xFF0000" instead of "0", I think it wants it in RGB form. I haven't tested though :|


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.