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