$PBExportHeader$gf_imagetopdf.srf
global type gf_imagetopdf from function_object
end type

forward prototypes
global function string gf_imagetopdf (string as_image)
end prototypes

global function string gf_imagetopdf (string as_image);String ls_pdf
nvo_scannerwia ln_wia
Long ll_rtn

ls_pdf = gs_dir +"tmp\tmp.pdf"

CreateDirectory(gs_dir +"tmp")
	
IF FileExists(ls_pdf) THEN FileDelete(ls_pdf)
	
ln_wia =  CREATE  nvo_scannerwia

ln_wia.of_ConvertPdf(as_image, ls_pdf)
	
//Checks the result
If ln_wia.il_ErrorType < 0 Then
  messagebox("Failed", ln_wia.is_ErrorText)
  ls_pdf =""
End If

DESTROY ln_wia

RETURN ls_pdf

end function

