Moin,
es gibt auf dieser Seite eine ZUGFeRD SDK .
SDK
dim InputDOC as string =”c:\doc\invoice.docx”
dim OutputPDFa as string =”c:\tmp\invoice.pdf”
‘please contact info@aloaha.com for your own evaluation key
Dim License as string=”RYCLN4JTUF2CF3OVUJUKZTAFIE”
If Aloaha_ZUGFeRD.PDF.DOC2PDFA(InputDOC, OutputPDFa, License) = True Then
If System.IO.File.Exists(OutputPDFa) = True Then
System.Diagnostics.Process.Start(OutputPDFa )
End If
End If
Dafür muss diese Zugferd DLL auf dem System regristiert werden.
Die Zugferd.dll ist erfolgreich regristiert, da ich schon mit der Erstellung von Zugferd Dokumenten arbeite.
Leider bekomme ich eine Fehlermeldung!
Spoiler anzeigen
#include <MsgBoxConstants.au3>
;~ ; Declare COM Object error handler:
Global $oComError = ObjEvent("AutoIt.Error", "_ComErrFunc")
Local $InputDOC = "c:\doc\invoice.docx"
Local $OutputPDFa = "c:\tmp\invoice.pdf"
Const $License = "RYCLN4JTUF2CF3OVUJUKZTAFIE"
Local $alo = ObjCreate("Aloaha_ZUGFeRD.XML"); Objekt von der Aloaha_ZUGFeRD.XML.dll erstellen! Sie muß vorher regristiert werden.
If @error Then
MsgBox(0 + 262144 + $MB_SETFOREGROUND + 16, "", "Aloaha_ZUGFeRD.XML nicht regristiert")
EndIf
If $alo.Aloaha_ZUGFeRD.PDF.DOC2PDFA($InputDOC, $OutputPDFa, $License) = True Then
If $alo.IO.File.Exists($OutputPDFa) = True Then
$alo.Diagnostics.Process.Start($OutputPDFa)
EndIf
EndIf
;~ ;--------------------------------------
;~ ; Function _ComErrFunc()
;~ ; Custom COM object error handler
;~ ;--------------------------------------
Func _ComErrFunc()
Local $HexNumber = Hex($oComError.number,8)
MsgBox(16, "AutoIT COM Error", "AutoIT COM Error Occured!" & @CRLF & _
@TAB & "Error Number: " & $HexNumber & @CRLF & _
@TAB & "Line Number: " & $oComError.scriptline & @CRLF & _
@TAB & "Description: " & $oComError.description & @CRLF & _
@TAB & "WinDescription: " & $oComError.windescription)
SetError(1) ; something to check for when this function returns
EndFunc ;==>_ComErrFunc
Könnt ihr mir helfen?