Jump to content

BlackShadow

Members
  • Posts

    10
  • Joined

  • Last visited

BlackShadow's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. I have been using the version modified by bdr529 successfully, but I have a slight issue with the image quality that I can't seem to figure out. I'm not sure if large JPG images gets degraded when added to a PDF, one big image per page, or if there is some other issue. But when I look at the PDF (in FoxIt) the images there have a lower quality than the original JPGs. The actual code is pretty small and simple: (Xmax and Ymax is the size in pixels of the JPG) _SetTitle("PDF") _SetSubject("PDF") _SetKeywords("PDF") _OpenAfter(True);open after generation _SetUnit($PDF_UNIT_CM) _SetPaperSize("CUSTOM",$Xmax, $Ymax) _SetZoomMode($PDF_ZOOM_FULLPAGE) _SetOrientation($PDF_ORIENTATION_PORTRAIT) _SetLayoutMode($PDF_LAYOUT_CONTINOUS) ;initialize the pdf _InitPDF(@ScriptDir & "\PDF.pdf") $time = @YEAR & @MON & @MDAY & @HOUR & @MIN & @SEC For $i = 1 to $pageCount _LoadResImage("img"&$time&$i, @ScriptDir & "\tmp\" & $i & ".jpg") Next For $i = 1 to $pageCount _BeginPage() ;scale image to paper size! _InsertImage("img"&$time&$i, 0, 0, _GetPageWidth()/_GetUnit(), _GetPageHeight()/_GetUnit()) _EndPage() Next _ClosePDFFile() On a sidenote, there is a small issue with MPDF when it comes to making several PDF without restarting, this is easily solved by resetting the page count with: Global $_Pages = 0 ; Which prob should have been done in _InitPDF.
  2. I made a small Func myself, but it still feels like I am missing something. (Ofcourse...) Func _SQLite_QueryNoResult($t_1,$t_2,$t_3) $dummy=0 _SQlite_Query ($t_1, $t_2, $t_3); the query While _SQLite_FetchData ($t_3, $dummy) = $SQLITE_OK WEnd EndFunc
  3. I wonder why I cant use the command _SQLite_QueryNoResult ? It doesn't work nor do my AutoIt editor (using the "built in" one) see it as a valid command. After searching the forums for it, I found info that it should have been implemented a long time ago, like 2005 or so, but I went ahead and updated my AutoIt just in case since it was a few months old, but it still doesnt work. It's not listed in my help file either btw. I'm prob just missing something trivial and being stupid, but any help is appreciated.
  4. I missed your post when I wrote my reply, but I guess this means it should work if I change my lines to something like: $ui_form = GUICreate("Programname " & Eval('version') , 801, 401, 202, 129) Not pretty, but as long as it works. Would prefer to just be able to toggle off the warnings from the compiler thou, and keep the code "cleaner". Thanks for the help anyway!
  5. Thanks for the replies, but I guess I need to make myself a bit more clear. I have a table with 2 fields in it. One is the Variable Name, the other is the Variable Value. _SQlite_Query (-1, "SELECT * FROM l_variables;", $hQuery); the query While _SQLite_FetchData ($hQuery, $aRow) = $SQLITE_OK Assign($aRow[0], $aRow[1]) WEnd Then I use those variables in my code late down, like here: $ui_form = GUICreate("Programname " & $version, 801, 401, 202, 129) And it's on that line I get the declaration error since $version have not been declared anywhere. Doing this in the loop above does nothing, except perhaps feel better: ; Eval("Global $" & $aRow[0]) And I do not want to manually declare my variables. I could solve it by making an include file for my programs (the system consists of several small programs), but I prefer to have my "global" variables/constants done in a DB and then accessed from all subprograms.
  6. I'm using Assign() to create variables during runtime, but the compiler itself gives me the following warnings/errors: WARNING: $version: possibly used before declaration. ERROR: $version: undeclared global variable. I tried using Eval() to create global declarations, but it doesnt seem to matter since AutoItSetOption("MustDeclareVars", 0) as default. (Even try adding that line just in case) So I guess I either need to make the compiler ignore those errors, since the file do work if I Ignore the erros, or I need find some way to dynamically declare dynamic variables......
  7. Thanks for the info, I'll work around it with FileInstall() instead then I guess. Perhaps Dampe shouldn't be so quick to reply next time?
  8. Using FileInstall() doesn't work, as I don't want it to save a copy of the actual database somewhere, or any other file either. But I took a quick look at resources.au3, but I'm not sure it can actually do what I want. I added this into the header: #AutoIt3Wrapper_run_after=ResHacker.exe -add %out%, %out%, database.db, rcdata, BIN_DB, 0 And this into the start of the code: $BIN_DB = _ResourceGet("BIN_DB", $RT_RCDATA) _SQLite_Open ($BIN_DB) And then compiled the program, but when I run the exe it doesn't seem to be able to actually do any searches in the DB, but it doesn't complain either, so atleast SQLite thinks it can open a file, just that it's empty or something. And yes, I got ResHacker fixed etc, so it's not something like that.
  9. Thanks, I did search, but obviously I used wrong keywords or typoed. Sorry for that, but really appreciate the help.
  10. I'm an old school programmer and I just started testing AU3 and I must say that I already love it. But I am curious if its possible to embed files in an AU3 script so it's included in the actual EXE? To be exact, what I want to do is to make a SQLite database which I want to access from a script in read only mode, but would prefer to have it in the actual EXE instead of having an additional file distributed with it. Thanks in advance!
×
×
  • Create New...