Need some help guys. Never really learned how to convert VBS's to KiX
Anyone who can give a clue? This is the VBS example:
Code:
' $Id: hello.vbs,v 1.11 2004/05/23 11:25:51 tm Exp $
'
' PDFlib client: hello example for COM with Windows Script Host and VBS
' Requires the PDFlib COM component
'
Option Explicit
Dim font
Dim oPDF
Set oPDF = WScript.CreateObject("PDFlib_com.PDF")
if (oPDF.begin_document("hello.pdf", "") = -1) then
WScript.Echo "Error: " & oPDF.get_errmsg
WScript.Quit(1)
end if
oPDF.set_info "Creator", "hello.vbs"
oPDF.set_info "Author", "Thomas Merz"
oPDF.set_info "Title", "Hello, world (COM/WSH)!"
oPDF.begin_page_ext 595, 842, ""
font = oPDF.load_font("Helvetica-Bold", "unicode", "")
oPDF.setfont font, 24
oPDF.set_text_pos 50, 700
oPDF.show "Hello, world!"
oPDF.continue_text "(says COM/VBS)"
oPDF.end_page_ext ""
oPDF.end_document ""
Set oPDF = Nothing
..and this is my failing attempt in KiX: Code:
$oPDF = CREATEOBJECT("PDFlib_com.PDF")
IF @ERROR
? "ERROR creating object: @ERROR (@SERROR)"
EXIT 1
ENDIF
IF $oPDF.begin_document("hello.pdf", "") = -1
? "ERROR: " + $oPDF.get_errmsg
EXIT 1
ENDIF
$oPDF.set_info = "Creator", "hello.vbs"
$oPDF.set_info = "Author", "Thomas Merz"
$oPDF.set_info = "Title", "Hello, world (COM/WSH)!"
$oPDF.begin_page_ext = 595, 842, ""
$font = $oPDF.load_font("Helvetica-Bold", "unicode", "")
$oPDF.setfont = $font, 24
$oPDF.set_text_pos = 50, 700
$oPDF.show = "Hello, world!"
$oPDF.continue_text = "(says COM/VBS)"
$oPDF.end_page_ext = ""
$oPDF.end_document = ""