-
Posts
99 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Reaper HGN's Achievements
Wayfarer (2/7)
0
Reputation
-
That is an interesting approach. I had not considered that, but it seems to produce the exact result I am looking for. Thanks again!
-
I am looking through the UDF to see if I can figure out how to set the background color of the PDF. By default, its white. I was hoping I could change it to black. Anyone have an idea of how to do that? Am I missing a simple variable somewhere? Thanks
-
Reaper HGN reacted to a post in a topic:
Create PDF from your application
-
@chimp That worked great! Thank you.
-
I narrowed the sample code down to the smallest that would create a PDF with a diagonal line. None of the "_insertimage" statements work though. Am I missing something? #include "..\MPDF_UDF.au3" ;set the properties for the pdf _SetUnit($PDF_UNIT_CM) _SetPaperSize("A4") _SetZoomMode($PDF_ZOOM_CUSTOM,90) _SetOrientation($PDF_ORIENTATION_PORTRAIT) _SetLayoutMode($PDF_LAYOUT_CONTINOUS) _OpenAfter(True);open after generation ;initialize the pdf _InitPDF(@ScriptDir & "\pdf_graphic_test.pdf") ;=== load resources used in pdf === ;images: _LoadResImage("taietel2", @ScriptDir & "\Images\gif.gif") _LoadResImage("taietel3", @ScriptDir & "\Images\jpg.jpg") _LoadResImage("taietel4", @ScriptDir & "\Images\ico.ico") _LoadResImage("taietel5", @ScriptDir & "\Images\tif.tif") _BeginPage() _InsertImage("taietel2", 2, 7, 5, 7) _InsertImage("taietel5", 2, 10.5, 7, 5) _InsertImage("taietel3", 2, 10.5, 7, 5) _InsertImage("taietel4", 2, 10.5,1,1) _DrawLine(2, 2, 12, 6, $PDF_STYLE_STROKED, 10, 0.1, 0x996600, 0, 0) _EndPage() _ClosePDFFile()
-
I am trying to get the mixed example to work in this UDF. In particular, I want to get images inserted into the PDF. After pulling down the 105 version and updating to 3.3.14.5, the mixed example works except the _insertimage function. I tried to follow a link to get 6 files from somewhere but that led me to the forum post indicating I should update. Does anyone have this UDF working with the _insertimage function?
-
I don't know for sure, but have you used a unc path for an image before? I have only ever used local paths which I have created as a resource directory on the target machine I am running on. I can say with certainty that I have used @scriptdir and a local path, but have not tried a unc or network path really.
-
I re-downloaded the code and tried to compile after re installing AutoIT to the version mentioned 3.3.8.1. It appears to compile fine now. I have not tested all yet, but notice a discrepancy in the size of the included exe and the version I compiled. Mine is much smaller. I tried no UPX as well, and it comes closer, but is still not as big as the included exe. Are there any includes that are not packaged in the include directory perhaps?
- 995 replies
-
- autoit ide
- autoit studio
-
(and 3 more)
Tagged with:
-
Thanks for the tremendous work. This is really great so far. I am trying to learn it well enough to adapt to the way I use AutoIT. One thing I definitely use alot with Guis is the OnEvent Mode rather than the Message Loop Mode. I looked all around in the Form studio, but am unable to find any option that allows the "Generate code" to provide OnEvent code. Am I missing it somewhere? I also went through all the posts before I posted so I didnt restate something. I noted that someone mentioned version control support with svn. I would love to see Git/Github support. Currently the backup function appears to copy the file over and over again even if changes havent been made. While I am not overly familiar with svn, I do know Git handles that pretty well. off topic, I noticed that all of the help files did not show any content when I downloaded and viewed them from ISN (compiled portable version, not installable version). I have seen this before and figured I would let people know that the zip file is "blocked" (by design). To resolve the situation, simply right click -> properties -> unblock before decompressing. Can I ask what version of AutoIt you are using for the .94 compile? I tried with my install and it failed for a number of reasons. I would just like to make sure I am starting with the same thing you are. Thanks! btw, using ISN .94 beta (v 23.07.2013) in portable mode on Win7 64bit
- 995 replies
-
- autoit ide
- autoit studio
-
(and 3 more)
Tagged with:
-
Activate Window in Linux OS using AutoIT
Reaper HGN replied to Shekar's topic in AutoIt GUI Help and Support
Perhaps AutoIT is not the right tool if you are using Linux. It is difficult to tell from your post exactly what you are trying to do, but Shell or Perl may be the better choice on Linux. If you are trying to do something via a webpage, wget can be used directly to make http calls. Again, hard to tell what you actually need from the post, so I could be way off on a potential solution. -
Pretty cool. Mostly for obfuscation?
-
I ran into this same issue today. I am using a laptop with a docking bay and a usb monitor adapter. The laptop does not like the primary monitor to be either the bay or the usb interface. I resorted to a technique I have used before to move a previously unreachable window to a monitor I could find. First, I enumerated all the windows with #include <process.au3> #include <array.au3> $a_windows = WinList() _ArrayDisplay($a_windows) Then I looked through the list after selecting the "Generate Form Code" and found the window I was looking for. The title is "Code", so I just added the winmove and presto, I can see the window now. PITA, but it works. #include <process.au3> #include <array.au3> $a_windows = WinList() _ArrayDisplay($a_windows) WinMove("Code","",60,60) I know this was caused when I moved the window when the computer was only attached to one monitor. If I disconnect the monitors, I can see part of the code window hanging off the side of the screen. I think I looked into this before and found a registry setting that retains the last open position of the window, but am unable to find it at the moment, so this works in a pinch.
-
Very cool little UDF. Definitely saves time with all the initialization. I was wondering how I would "clear" the console without doing something obvious like scrolling a bunch of lines? I tried sending a cls command via stdinwrite, but that hasnt been successful yet. Edit - seems like the system("cls") might do it...
-
Au3Localizer - Localize AutoIt Scripts
Reaper HGN replied to MrCreatoR's topic in AutoIt Example Scripts
Very cool idea. I don't have a use at the moment, but I have done this in the past and think something that flags the possible lines like this does would have been very helpful. -
I'm certain you are right, there are a number of inefficiencies. I appreciate you looking. Even though it isn't the best code, I learned a lot with this exercise .
-
I am currently working through my DMC. Part of that requires a pretty good understanding of the RDP tables and how to calculate various pressure groups, surface intervals and repetitive dive data. Admittedly I was a little weak in this area, so I thought what better way to really cement the subject, than to program a utility to do the calculations for me. It seems counter intuitive, but if you know a subject well enough to write a program, you end up learning quite a bit about it. Anyway, this script takes the initial dive depth, dive time, surface interval and planned second dive depth. It will then calculate the initial pressure group, the ending pressure group after the surface interval, and the adjusted actual (allowable) bottom time for that second dive. A couple of caveats. I looked extensively and found that the PADI tables that I used are copyrighted, but the data itself is public domain. So as far as I can tell, its ok to contain the data in the code. Also, I manually input the data (which is quite a bit). There may be some transcription errors, so just be aware of that. Let me know what you think. ;***************************************** ;Dive_Calc.au3 by David Sisson ;***************************************** #Include <Array.au3> $i_depth = 50 $i_time = 50 $i_surfaceinterval = "0:39" $i_depth2 = 30 $i_tabledepth = _GetTableDepth($i_depth) $s_tablepressuregroup = _GetPressureGroup($i_time, $i_tabledepth) $s_endingtablepressuregroup = _GetPressureGroupAfterSurfaceInterval($s_tablepressuregroup, $i_surfaceinterval) $i_tabledepth2 = _GetTableDepth($i_depth2) $i_adjustedbottomtime = _GetPressureGroup($i_time, $i_tabledepth2, $s_endingtablepressuregroup) consolewrite ("Dive depth:" & $i_depth & @CRLF) ConsoleWrite ("Dive table depth:" & $i_tabledepth & @CRLF) consolewrite ("Dive time:" & $i_time & @CRLF) ConsoleWrite ("Pressure group:" & $s_tablepressuregroup & @CRLF) ConsoleWrite ("Surface Interval (minutes):" & _ConvertToMinutes($i_surfaceinterval) & @CRLF) ConsoleWrite ("Ending pressure group:" & $s_endingtablepressuregroup & @CRLF) ConsoleWrite ("Second Dive depth:" & $i_depth2 & @CRLF) ConsoleWrite ("Adjusted actual bottom time:" & $i_adjustedbottomtime & @CRLF) Func _GetPressureGroup($_time, $_depth, $_pg="") local $_pressuregroups[26] = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"] local $_suffix = "" if $_pg <> "" Then ;find the index for the pressure group for $j = 0 to UBound($_pressuregroups)-1 if $_pressuregroups[$j] == StringLeft($_pg,1) Then $_pgindex = $j EndIf Next $_arraytouse = _GetArrayToUse($_depth) $_rnt = $_arraytouse[$_pgindex] $_abt = $_arraytouse[UBound($_arraytouse)-1]*1 - $_rnt Return $_abt EndIf $_arraytouse = _GetArrayToUse($_depth) for $i = 0 to UBound($_arraytouse)-1 if $_time <= $_arraytouse[$i] Then if StringInStr($_arraytouse[$i],"*") Then $_suffix = ", SS required" if StringInStr($_arraytouse[$i],"&") Then $_suffix = ", SS required. Max limit reached." Return $_pressuregroups[$i] & $_suffix EndIf Next Return ("Too long") EndFunc Func _GetTableDepth($_depth) local $_tabledepths[12] = [35,40,50,60,70,80,90,100,110,120,130,140] for $i = 0 to UBound($_tabledepths)-1 ;compare depth to range if $_depth <= $_tabledepths[$i]*1 Then Return $_tabledepths[$i] Next Return ("Too deep") EndFunc Func _GetPressureGroupAfterSurfaceInterval($_pressuregroup, $_surfaceinterval) local $_pressuregroups[26] = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"] local $_si, $_currentpressuregroup $_si = _ConvertToMinutes($i_surfaceinterval) if $_si = 0 Then Return "No additional dives." $_tablesurfaceintervals = _GetPressureArrayToUse($_pressuregroup) ReDim $_pressuregroups[ubound($_tablesurfaceintervals)] _ArrayReverse($_pressuregroups) for $i = UBound($_tablesurfaceintervals)-1 to 0 step -1 if _ConvertToMinutes($_si)*1 <= _ConvertToMinutes($_tablesurfaceintervals[$i])*1 Then $_currentpressuregroup = $_pressuregroups[$i] EndIf Next if $_currentpressuregroup <> "" Then Return $_currentpressuregroup Else Return ("No pressure group") EndIf EndFunc Func _GetArrayToUse($_depth) local $_bottomtime35[26] = [10,19,25,29,32,36,40,44,48,52,57,62,67,73,79,85,92,100,108,117,127,139,"152*","168*","188*","205&"] local $_bottomtime40[26] = [9,16,22,25,27,31,34,37,40,44,48,51,55,60,64,69,74,79,85,91,97,104,"111*","120*","129*","140&"] local $_bottomtime50[24] = [7,13,17,19,21,24,26,28,31,33,36,39,41,44,47,50,53,57,60,63,"67*","71*","75*","80&"] local $_bottomtime60[23] = [6,11,14,16,17,19,21,23,25,27,29,31,33,35,37,39,42,44,47,"49*","52*","54*","55&"] local $_bottomtime70[20] = [5,9,12,13,15,16,18,19,21,22,24,26,27,29,31,33,"35*","36*","38*","40&"] local $_bottomtime80[18] = [4,8,10,11,13,14,15,17,18,19,21,22,23,25,"26*","28*","29*","30&"] local $_bottomtime90[17] = [4,7,9,10,11,12,13,15,16,17,18,19,21,"22*","23*","24*","25&"] local $_bottomtime100[15] = ["3*","6*","8*","9*","10*","11*","12*","13*","14*","15*","16*","17*","18*","19*","20&"] local $_bottomtime110[13] = ["3*","6*","7*","8*","9*","10*","11*","12*","13*",-9999,"14*","15*","16&"] local $_bottomtime120[11] = ["3*","5*","6*","7*","8*","9*","10*","11*",-9999,"12*","13&"] local $_bottomtime130[8] = ["3*","5*","6*","7*",-9999,"8*","9*","10&"] local $_bottomtime140[6] = [-9999,"4*","5*","6*","7*","8&"] $_depth = $_depth*1 Select Case $_depth = 35 Return $_bottomtime35 Case $_depth = 40 Return $_bottomtime40 Case $_depth = 50 Return $_bottomtime50 Case $_depth = 60 Return $_bottomtime60 Case $_depth = 70 Return $_bottomtime70 Case $_depth = 80 Return $_bottomtime80 Case $_depth = 90 Return $_bottomtime90 Case $_depth = 100 Return $_bottomtime100 Case $_depth = 110 Return $_bottomtime110 Case $_depth = 120 Return $_bottomtime120 Case $_depth = 130 Return $_bottomtime130 Case $_depth = 140 Return $_bottomtime140 EndSelect EndFunc Func _GetPressureArrayToUse($_startingpressuregroup) local $_surfaceintervalA[1] = ["3:00"] local $_surfaceintervalB[2] = ["0:47","3:48"] local $_surfaceintervalC[3] = ["0:21","1:09","4:10"] local $_surfaceintervalD[4] = ["0:08","0:30","1:18","4:19"] local $_surfaceintervalE[5] = ["0:07","0:16","0:38","1:27","4:28"] local $_surfaceintervalF[6] = ["0:07","0:15","0:24","0:46","1:34","4:35"] local $_surfaceintervalG[7] = ["0:06","0:13","0:22","0:31","0:53","1:41","4:42"] local $_surfaceintervalH[8] = ["0:05","0:12","0:20","0:28","0:37","0:59","1:47","4:48"] local $_surfaceintervalI[9] = ["0:05","0:11","0:18","0:26","0:34","0:43","1:05","1:53","4:54"] local $_surfaceintervalJ[10] = ["0:05","0:11","0:17","0:24","0:31","0:40","0:49","1:11","1:59","5:00"] local $_surfaceintervalK[11] = ["0:04","0:10","0:16","0:22","0:29","0:37","0:45","0:54","1:16","2:04","5:05"] local $_surfaceintervalL[12] = ["0:04","0:09","0:15","0:21","0:27","0:34","0:42","0:50","0:59","1:21","2:09","5:10"] local $_surfaceintervalM[13] = ["0:04","0:09","0:14","0:19","0:25","0:32","0:39","0:46","0:55","1:04","1:25","2:14","5:15"] local $_surfaceintervalN[14] = ["0:03","0:08","0:13","0:18","0:24","0:30","0:36","0:43","0:51","0:59","1:08","1:30","2:18","5:19"] local $_surfaceintervalO[15] = ["0:03","0:08","0:12","0:17","0:23","0:28","0:34","0:41","0:47","0:55","1:03","1:12","1:34","2:23","5:24"] local $_surfaceintervalP[16] = ["0:03","0:07","0:12","0:16","0:21","0:27","0:32","0:38","0:45","0:51","0:59","1:07","1:16","1:38","2:27","5:28"] local $_surfaceintervalQ[17] = ["0:03","0:07","0:11","0:16","0:20","0:25","0:30","0:36","0:42","0:48","0:55","1:03","1:11","1:20","1:42","2:30","5:31"] local $_surfaceintervalR[18] = ["0:03","0:07","0:11","0:15","0:19","0:24","0:29","0:34","0:40","0:46","0:52","0:59","1:07","1:15","1:24","1:46","2:34","5:35"] local $_surfaceintervalS[19] = ["0:03","0:06","0:10","0:14","0:18","0:23","0:27","0:32","0:38","0:43","0:49","0:56","1:03","1:10","1:18","1:27","1:49","2:38","5:39"] local $_surfaceintervalT[20] = ["0:02","0:06","0:10","0:13","0:17","0:22","0:26","0:31","0:36","0:41","0:47","0:53","0:59","1:06","1:13","1:22","1:31","1:53","2:41","5:42"] local $_surfaceintervalU[21] = ["0:02","0:06","0:09","0:13","0:17","0:21","0:25","0:29","0:34","0:39","0:44","0:50","0:56","1:02","1:09","1:17","1:25","1:34","1:56","2:44","5:45"] local $_surfaceintervalV[22] = ["0:02","0:05","0:09","0:12","0:16","0:20","0:24","0:28","0:33","0:37","0:42","0:47","0:53","0:59","1:05","1:12","1:20","1:38","1:37","1:59","2:47","5:48"] local $_surfaceintervalW[23] = ["0:02","0:05","0:08","0:12","0:15","0:19","0:23","0:27","0:31","0:36","0:40","0:45","0:50","0:56","1:02","1:08","1:15","1:23","1:31","1:40","2:02","2:50","5:51"] local $_surfaceintervalX[24] = ["0:02","0:05","0:08","0:11","0:15","0:18","0:22","0:26","0:30","0:34","0:39","0:43","0:48","0:53","0:59","1:05","1:11","1:18","1:26","1:34","1:43","2:05","2:53","5:54"] local $_surfaceintervalY[25] = ["0:02","0:05","0:08","0:11","0:14","0:18","0:21","0:25","0:29","0:33","0:37","0:41","0:46","0:51","0:56","1:02","1:08","1:14","1:21","1:29","1:37","1:46","2:08","2:56","5:57"] local $_surfaceintervalZ[26] = ["0:02","0:05","0:8","0:11","0:14","0:17","0:20","0:24","0:28","0:31","0:35","0:40","0:44","0:49","0:54","0:59","1:05","1:11","1:17","1:24","1:31","1:40","1:49","2:11","2:59","6:00"] $_startingpressuregroup = StringLeft($_startingpressuregroup,1) ; <- removes the SS and limit notes Select Case $_startingpressuregroup = "A" Return $_surfaceintervalA Case $_startingpressuregroup = "B" Return $_surfaceintervalB Case $_startingpressuregroup = "C" Return $_surfaceintervalC Case $_startingpressuregroup = "D" Return $_surfaceintervalD Case $_startingpressuregroup = "E" Return $_surfaceintervalE Case $_startingpressuregroup = "F" Return $_surfaceintervalF Case $_startingpressuregroup = "G" Return $_surfaceintervalG Case $_startingpressuregroup = "H" Return $_surfaceintervalH Case $_startingpressuregroup = "I" Return $_surfaceintervalI Case $_startingpressuregroup = "J" Return $_surfaceintervalJ Case $_startingpressuregroup = "K" Return $_surfaceintervalK Case $_startingpressuregroup = "L" Return $_surfaceintervalL Case $_startingpressuregroup = "M" Return $_surfaceintervalM Case $_startingpressuregroup = "N" Return $_surfaceintervalN Case $_startingpressuregroup = "O" Return $_surfaceintervalO Case $_startingpressuregroup = "P" Return $_surfaceintervalP Case $_startingpressuregroup = "Q" Return $_surfaceintervalQ Case $_startingpressuregroup = "R" Return $_surfaceintervalR Case $_startingpressuregroup = "S" Return $_surfaceintervalS Case $_startingpressuregroup = "T" Return $_surfaceintervalT Case $_startingpressuregroup = "U" Return $_surfaceintervalU Case $_startingpressuregroup = "V" Return $_surfaceintervalV Case $_startingpressuregroup = "W" Return $_surfaceintervalW Case $_startingpressuregroup = "X" Return $_surfaceintervalX Case $_startingpressuregroup = "Y" Return $_surfaceintervalY Case $_startingpressuregroup = "Z" Return $_surfaceintervalZ EndSelect EndFunc Func _ConvertToMinutes($_value) if StringInStr($_value,":") Then $_elements = StringSplit($_value, ":") $_totalmin = $_elements[1]*60 + $_elements[2] Return $_totalmin Else Return $_value EndIf EndFunc