CarontePizzuto Posted February 19, 2018 Share Posted February 19, 2018 Hello, this udf + dll is the maximum for printing without using other applications (word - excel - pdf - etc.) The only lack is the impossibility of being able to set the size of the sheet! I have to print a report on an A2 sheet how do I do it? Thank you Link to comment Share on other sites More sharing options...
martin Posted March 17, 2018 Author Share Posted March 17, 2018 I don't know why setting the paper size wasn't ever included in the udf, but if you still need this I will try to add something. If I don't see a reply over the next week then I will do nothing on the assumption that I am too late to help. 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. Link to comment Share on other sites More sharing options...
CarontePizzuto Posted March 31, 2018 Share Posted March 31, 2018 Thank you so much Martin. I apologize if I have not answered before but I have been very busy. I solved using the dll "PSCRIPT.dll" (http://www.pagescript32.com/) Link to comment Share on other sites More sharing options...
x_bennY Posted July 2, 2018 Share Posted July 2, 2018 On 31/03/2018 at 4:57 PM, CarontePizzuto said: Thank you so much Martin. I apologize if I have not answered before but I have been very busy. I solved using the dll "PSCRIPT.dll" (http://www.pagescript32.com/) @CarontePizzuto, could you post your code? Link to comment Share on other sites More sharing options...
juzis28 Posted November 1, 2018 Share Posted November 1, 2018 On 11/9/2017 at 12:15 AM, juzis28 said: up. autoselecting printer still does not work... Link to comment Share on other sites More sharing options...
Sundance Posted February 11, 2019 Share Posted February 11, 2019 (edited) Hi Martin, I use your DLL for a little project where we are printing some labels with the help of a brother label printer. I create a QR code with createQRw.au3 and add some text to the right of it. There are two things I still have a problem. First of all I would like (also) have the ability to set the paper size to a specific value so that the user hasn't to do so. Cause when the length of the label isn't right the QR code has not a square size and won't be recognized by our scanner. The second thing is a problem I hope you have an idea. On some computers my script prints an empty second page and I don't know why. Even when the printer settings and the text to be printed and all computers are teh same. Do you have any hints for me Martin? (I'am using the _PrintImage function. It also prints a second page when printing a tiny pic which fits into the page bounderies) Is there an ability to force the printer to only print one page? many thanks in advance Martin Sundance Edited February 11, 2019 by Sundance spelling Link to comment Share on other sites More sharing options...
Scorpio Posted May 31, 2019 Share Posted May 31, 2019 I'm downloading the UDF, very helpfull for me. Many Thanks. PS: Read the PM. Link to comment Share on other sites More sharing options...
izifarhan Posted July 10, 2019 Share Posted July 10, 2019 Hi First thank for your work on creathing this UDF and DLL. Work wanderfull. Is it possible to upgrade the DLL to 64bit ? Link to comment Share on other sites More sharing options...
SimonRu Posted February 3, 2020 Share Posted February 3, 2020 Hi all, I'm using this for printing to various label printers. I need one line of text to be rotated 180 degrees. How would I go about doing this as it's not totally obvious? Many thanks. Link to comment Share on other sites More sharing options...
geller Posted June 4, 2020 Share Posted June 4, 2020 (edited) I have been using this UDF, quite successfully, for some time, but I have found the following issues: First, _PrintPageOrientation doesn't seem to have any effect, printing to PDF or to my Brother printer (HL-1850). 2nd, _PrintDllStart always fails if I previously do a screen capture with _ScreenCapture_CaptureWnd. I am using Windows 7. Here is sample code that illustrates these problems. expandcollapse popup#include <ListViewConstants.au3> #include <printMGv2.au3> #include <ScreenCapture.au3> #include <WindowsConstants.au3> #include <GUIConstants.au3> #include <GUIConstantsEx.au3> Local $Frm1 = GUICreate("Test", 1200, 650, -1, -1) Local $LVhdrs = " Rec. |Last|First" Local $idListview = GUICtrlCreateListView($LVhdrs, 10, 10, 1200, 600, BitOR($GUI_SS_DEFAULT_LISTVIEW,$WS_VSCROLL)) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_LV_ALTERNATE) GUICtrlSetBkColor(-1, 0xFFFFFF) ; 0xEAEAEA) Local $idListview_Handle = GUICtrlGetHandle($idListview) Local $btnSave = GUICtrlCreateButton("Save (Screen Capture)", 400, 620, 150, 22) Local $btnPrint = GUICtrlCreateButton("Print", 600, 620, 150, 22) Local $aLVRowID[20] For $ii = 0 To UBound($aLVRowID)-1 $aLVRowID[$ii] = GUICtrlCreateListViewItem($ii+1 & "|" & "Last Name " & $ii+1 & "|" & "First Name " & $ii+1, $idListview) GUICtrlSetBkColor(-1, 0xEBEBEB) ; 0xFCF6EA) Next GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE GUIDelete($Frm1) ExitLoop Case $btnSave SaveImage($idListview_Handle) Case $btnPrint PrintIt() EndSwitch WEnd Func SaveImage($hHandle) Local $sFileName = FileSaveDialog("Save Screen Capture", @MyDocumentsDir, "(*.jpg;*.jpeg;*.bmp;*.tif;*.tiff)", $FD_PROMPTOVERWRITE + $FD_PATHMUSTEXIST) If @error Then Return Else sleep (1000) ; give time for dialog to disappear before starting screen capture EndIf ;_ScreenCapture_SetJPGQuality(80) ; default is 100 _ScreenCapture_CaptureWnd ($sFileName, $hHandle, 0, 0, -1, -1, False) ShellExecute($sFileName) ; display saved image using default viewer EndFunc Func PrintIt() Local $msg $hDll = _PrintDllStart($msg);this must always be called first if $hDll < 1 then MsgBox(48,"Printer Error", "Error from dllstart = " & $msg) Return EndIf Local $prnChoice = _PrintSetPrinter($hDll) ; opens choose printer dialogue If $prnChoice = 0 Then _PrintDllClose($hDll) Return EndIf _PrintStartPrint($hDll) _PrintPageOrientation($hDll, 1) ; 0 = portrait, 1 = landscape *** DOESN'T SEEM TO WORK... MsgBox(0,"","Now printing") _PrintEndPrint($hDll) _PrintDllClose($hDll);this must always be called last EndFunc Edited June 4, 2020 by geller Link to comment Share on other sites More sharing options...
geller Posted June 5, 2020 Share Posted June 5, 2020 After further experimentation, it seems that the problem lies with the ScreenCapture UDF, not the Print UDF, as SQlite will also not start up after _ScreenCapture was invoked. However, this problem seems to occur only when running uncompiled script. Once compiled, it seems to work OK. Link to comment Share on other sites More sharing options...
SimonRu Posted June 18, 2020 Share Posted June 18, 2020 I've started trying to work with this again and I've noticed a new problem that I don't think has been reported: it ignores all printing defaults set in the printer properties and does some other defaults. I'm working with a label printer and I've set speed and density in the printing defaults, but this UDF just does whatever it wants. Am I missing something? Link to comment Share on other sites More sharing options...
dmphim Posted December 17, 2020 Share Posted December 17, 2020 Thank for your work on creathing this UDF and DLL. But, the UDF does not support Unicode Encoding. All text is converted to ANSI before printing. Hope to see an update of dll and this UDF, supporting multi-encoding in the future. Thanks! Link to comment Share on other sites More sharing options...
abberration Posted January 31, 2021 Share Posted January 31, 2021 (edited) Hi, Martin I found a need for this UDF yesterday. I needed to create a way of making a page of small labels (to price things I will be selling). I got it working just fine and THANK YOU FOR MAKING THIS UDF, IT HELPED ME TREMENDOUSLY! I did find a couple interesting complications that I didn't expect. I thought I should mention them, not sure if they are noteworthy. 1. I tried to make a GUI with Koda using pixels to space plan the sheet. However, the pixel numbers for the GUI didn't line up with the pixel spacing with your UDF (I assume it has to do with DPI, not GUI pixels). I had to use the good old trial-and-error method to get the correct font size, bold setting and spacing on the x and y axis. But after about 30 pieces of paper (small price to pay🤑), I got it perfect. My final product looks very professional. Am I correct about the DPI vs. pixels theory? 2. My initial runs were scripted with a simple .au3 file. Later, I converted that .au3 file into a function. I ran into all kinds of crashes, errors or nothing happening. I tried to pass variables into the function or make them global, but I couldn't make the function work. My best solution was to make an independent .exe (using your same UDF) for the final print phase and have it read the data from a .txt file. Using your UDF as a standalone file reading data, it works great. But I had lots of problems using it inside a function. The problem was probably my code, but I got it working, so I'm happy. Edit: Tonight, I was re-working some of the code and discovered exactly what my problem here was. The independent .exe was compiled as 32-bit (to be compatible with the .dll). When I run the code as an .au3, AutoIt runs scripts 64-bit by default (I chose this when installing AutoIt). Compiling the separate script works very well. Thanks again! I really love this UDF! If it weren't for this UDF, I would still be manually typing up every label in MS Word (very tedious). Edited July 17, 2021 by abberration Discovered the exact reason for my problem #2. Easy MP3 | Software Installer | Password Manager Link to comment Share on other sites More sharing options...
joiner Posted March 8, 2021 Share Posted March 8, 2021 Hello print to pdf file does not print yellow. Why? #include <printMGv2.au3> _TextToPrint('CutePDF Writer') Func _TextToPrint($sNamePrint) Local $aTextP = FileReadToArray(@ScriptDir & '\text.txt') Local $hOD = _PrintDllStart() _PrintSelectPrinter($hOD, $sNamePrint) _PrintPageOrientation($hOD, 1) _PrintStartPrint($hOD) Local $y = 60, $iC = 0 Local $aCol[4] = [0xFF0000, 0x0000FF, 0xFFFF00, 0x000000];blue red yellow black For $n = 0 To UBound($aTextP) - 1 If $iC = 4 Then $iC = 0 _PrintSetFont($hOD, 'Courier', 12, $aCol[$iC]) $iC += 1 _PrintText($hOD, $aTextP[$n], 35, $y) $y += 43 Next _PrintEndPrint($hOD) _PrintNewPage($hOD) _PrintDllClose($hOD) EndFunc ;==>_TextToPrint Link to comment Share on other sites More sharing options...
joiner Posted March 12, 2021 Share Posted March 12, 2021 solution: yellow - 0x00FFFF but in autoit it is Cyan Link to comment Share on other sites More sharing options...
Parsix Posted October 13, 2021 Share Posted October 13, 2021 (edited) Download link are dead Edited October 13, 2021 by Parsix Link to comment Share on other sites More sharing options...
mLipok Posted October 13, 2021 Share Posted October 13, 2021 (edited) 2 minutes ago, Parsix said: links are dead Do you think any one will guess which link you mean ❓ Please use this feature: Edited October 13, 2021 by mLipok Parsix 1 Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24 Link to comment Share on other sites More sharing options...
Parsix Posted October 13, 2021 Share Posted October 13, 2021 downlod links in first post Link to comment Share on other sites More sharing options...
Parsix Posted October 13, 2021 Share Posted October 13, 2021 On 8/10/2007 at 2:06 AM, martin said: This is a printing UDF which allows you to print text in any font, size and colour at any position on the page, draw lines, curves, elipses, pies in any colour, and print images. Useful for labels, reports, graphs and standard forms. Can also print barcodes. It uses my printmg.dll. It is not intended to do the sorts of thing you can do with the Word UDF by big_daddy. Note the dll is 32 bit and so only works with 32 bit applications.printout from the code in the example in the download. Functions available are -Start using/Finish using the UDF _PrintDllStart _PrintDllClose _PrintVersion - Returns version of UDF or dll _PrintSetTitlePrinter control _PrintStartPrint _PrintAbort _PrintEndPrint _PrintNewPagePrinter selection, getting & setting parameters _PrintListPrinters - lists all installed printers _PrintSetPrinter - manual printer selection dialogue _PrintSelectPrinter - programmatically set the printer. _PrintGetPageWidth _PrintGetPaperWidth _PrintGetPageHeight _PrintGetPaperHeight _PrintGetHorRes _PrintGetVertRes _PrintGetXOffset _PrintGetYOffset _PrintPageOrientation - set portrait or landsacpeText printing _PrintSetFont - Font, size, attributes and colour _PrintText - At x,y and angle. _PrintGetextWidth _PrintGetTextHeightGraphics _PrintSetLineCol _PrintSetLIneWid _PrintSetBrushCol - sets the colour used for filling _PrintLine _PrintEllipse - Filled ellipse or circle _PrintPie - for filled pie slice _PrintArc - Elliptical or circular arcs _PrintRectangle - filled rectangle _PrintRoundedRectangle _PrintImage - prints jpg, bmp and ico files (Has problems with some icons bigger than 64 x 64) _PrintImageFromDC Latest change = 25th February 2011 Added example to the download which was missing.Get the UDF, dll and example from here. ================================================================= See also these udf's for printing from AutoIt using the Windows API and not using a dll. by GRS - http://www.autoitscript.com/forum/topic/...m-autoit/page__view__findpost_ by Prog@ndy -http://www.autoitscript.com/forum/topic/...gdi-udfs/page__view__findpost_ and this one which embeds a dll in the script for creating pdf files. printing to a pdf by taietel see Download Links are dead Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now