Jump to content

ElTiburon

Members
  • Posts

    2
  • Joined

  • Last visited

ElTiburon's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Hi all, after I updated AutoIt to the latest version 2 functions not working anymore: ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GetTextLength ; Description ...: Get the length of a string ; Syntax ........: _GetTextLength( $sText , $sFontAlias , $iFontSize ) ; Parameters ....: $sText - string value. ; $sFontAlias - string value. ; $iFontSize - integer value. ; Return values .: None ; Author(s) .....: Mihai Iancu (taietel at yahoo dot com) ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: http://www.autoitscript.com/forum/topic/118827-create-pdf-from-your-application/ ; Example .......: No ; =============================================================================================================================== Func _GetTextLength($sText, $sFontAlias, $iFontSize) Local $k = StringInStr($_sFONTNAME, "<" & $sFontAlias & ">") Local $C Local $l = StringLen($sText) Local $j = 0 If $k > 0 Then $k += StringLen($sFontAlias) + 2 For $i = 1 To $l $C = Asc(StringMid($sText, $i, 1)) $k += _Iif(($C >= $FirstChar) And ($C <= $LastChar), $Widths[$C], $MissingWidth) If $C = 32 Then $j += 1 Next EndIf Return __ToUser((($k * $iFontSize / 1000) + ($j * $_WordSpacing) + ($l * $_CharSpacing)) * ($_TextScaling / 100)) EndFunc ;==>_GetTextLength; #FUNCTION# ==================================================================================================================== ; Name ..........: _ClosePDFFile ; Description ...: Write the buffer to the pdf ; Syntax ........: _ClosePDFFile( ) ; Parameters ....: ; Return values .: None ; Author(s) .....: Mihai Iancu (taietel at yahoo dot com) ; Modified ......: ; Remarks .......: ; Related .......: _InitPDF() ; Link ..........: http://www.autoitscript.com/forum/topic/118827-create-pdf-from-your-application/ ; Example .......: No ; =============================================================================================================================== Func _ClosePDFFile() $_iResource = __InitObj(4) __ToBuffer("<<" & _ _Iif($_sFONT <> "", "/Font<<" & $_sFONT & ">>", "") & _ "/ProcSet [/PDF/Text" & _Iif($_Image <> "", "/ImageB/ImageC/ImageI", "") & "]" & _ _Iif(($_Image <> "") Or ($_sObject <> ""), "/XObject <<" & $_Image & $_sObject & ">>", "") & ">>") __EndObj() $_iPages = __InitObj(3) __ToBuffer("<</Type /Pages /Count " & $_Pages & " /MediaBox [0 0 " & __ToStr($_PageWidth,1) & " " & __ToStr($_PageHeight,1) & "] " & _ "/CropBox [" & __ToStr($__SetMargin) & " " & __ToStr($__SetMargin) & " " & __ToStr($_PageWidth - $__SetMargin,1) & " " & __ToStr($_PageHeight - $__SetMargin,1) & "] " & _ _Iif($_Orientation = $PDF_ORIENTATION_LANDSCAPE, "/Rotate -90", "") & "/Kids [" & $_sPage & "] " & "/Resources " & $_iResource & " 0 R>>") __EndObj() __ToBuffer("xref") __ToBuffer("0 " & $_iMaxObject+1) __ToBuffer("0000000000 65535 f") For $i = 1 To $_iMaxObject __ToBuffer($aXREF[$i]) Next __ToBuffer("trailer" & @CRLF & _ "<< /Size " & $_iMaxObject + 1 & "/Info 1 0 R" & "/Root 2 0 R" & ">>") __ToBuffer("startxref" & @CRLF & StringLen("startxref" & @CRLF & $_Buffer & "%%EOF" & @CRLF) + 6) $_FileName = FileOpen($PDF_NAME,18) FileWrite($_FileName, $_Buffer & "%%EOF" & @CRLF) FileClose($_FileName) $_Pages = "" $_sPage = "" $_sFONT = "" $_Image = "" $_sObject = "" $_iResource = "" $_Buffer = "" If $_bOpen Then ShellExecute($PDF_NAME) EndFunc ;==>_ClosePDFFileThe Error is: "error: _Iif(): undefined function." Please can anybody help me? Thank all who takes the time to help me With best regards ElTiburon
  2. Hi, I'm new here. Thanks for your script. I like it. It works for me, but I have an question: How i can make a processbar for creating a checksum? I mean then the prozess starts e.g. an file with 1GB size it takes a time. What I want is an processbar to see how long it takes. I think it must be in the callroutine of the DLL process. I'm learning and don't try itself with external DLLs. I will script 2 processbars. One for the active process to see how long takes the actual file, and one to see how many files to check. I scripted for me to recursive a directory in an array. From that I take on file and sent it to your routine. After that I save the result in an additional Array. The progressbar for how many files to complete is easy, but how long it takes to check one file I don't know how I can solve this. Look at the Programm: "QuickSFV v2.36". I want the same 2 progressbars. Sorry for my english, I hope you understood me. Thanks for the time and help for all who can help me to solve this. With best regards to all ElTiburon
×
×
  • Create New...