Interfaces: Remove obsolete pdf_zugferd_test.exe
This commit is contained in:
@@ -40,23 +40,12 @@ Public Class ZUGFeRDInterface
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Validates a ZUGFeRD File and extracts the XML Document from it
|
||||
''' </summary>
|
||||
''' <param name="Path"></param>
|
||||
''' <exception cref="ZUGFeRDExecption"></exception>
|
||||
''' <returns></returns>
|
||||
Public Function ExtractZUGFeRDFile(Path As String) As CrossIndustryDocumentType
|
||||
Dim oXmlDocument = ValidateZUGFeRDFile(Path)
|
||||
|
||||
If IsNothing(oXmlDocument) Then
|
||||
Throw New ZUGFeRDExecption(ErrorType.NoZugferd, "Datei ist keine ZUGFeRD Datei.")
|
||||
End If
|
||||
|
||||
Return SerializeZUGFeRDDocument(oXmlDocument)
|
||||
End Function
|
||||
|
||||
Public Function ExtractZUGFeRDFileWithGDPicture(Path As String) As CrossIndustryDocumentType
|
||||
Dim oXmlDocument = ValidateZUGFeRDFileWithGDPicture(Path)
|
||||
|
||||
@@ -67,6 +56,12 @@ Public Class ZUGFeRDInterface
|
||||
Return SerializeZUGFeRDDocument(oXmlDocument)
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Validates a ZUGFeRD File and extracts the XML Document from it
|
||||
''' </summary>
|
||||
''' <param name="Stream"></param>
|
||||
''' <exception cref="ZUGFeRDExecption"></exception>
|
||||
''' <returns></returns>
|
||||
Public Function ExtractZUGFeRDFileWithGDPicture(Stream As Stream) As CrossIndustryDocumentType
|
||||
Dim oXmlDocument = ValidateZUGFeRDFileWithGDPicture(Stream)
|
||||
|
||||
@@ -77,50 +72,12 @@ Public Class ZUGFeRDInterface
|
||||
Return SerializeZUGFeRDDocument(oXmlDocument)
|
||||
End Function
|
||||
|
||||
Public Function ValidateZUGFeRDFile(Path As String) As XPathDocument
|
||||
Dim oProcessOutput, oProcessError As String
|
||||
Dim oXmlDocument As XPathDocument
|
||||
Dim oTempFile = IO.Path.GetTempFileName()
|
||||
|
||||
Dim oProcess As New Process() With {
|
||||
.StartInfo = New ProcessStartInfo() With {
|
||||
.FileName = ZUGFERD_CONVERTER_EXE,
|
||||
.RedirectStandardError = True,
|
||||
.RedirectStandardOutput = True,
|
||||
.UseShellExecute = False,
|
||||
.Arguments = $"-i ""{Path}"" -o ""{oTempFile}"""
|
||||
}
|
||||
}
|
||||
|
||||
Try
|
||||
oProcess.Start()
|
||||
oProcessOutput = oProcess.StandardOutput.ReadToEnd()
|
||||
oProcessError = oProcess.StandardError.ReadToEnd()
|
||||
oProcess.WaitForExit()
|
||||
|
||||
_logger.Debug("Process Output:")
|
||||
_logger.Debug(oProcessOutput)
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
Throw ex
|
||||
End Try
|
||||
|
||||
If Not oProcessOutput.ToLower.Contains(ZUGFERD_CONVERTER_SUCCESS_MESSAGE.ToLower) Then
|
||||
_logger.Warn("File {0} is not a valid ZUGFeRD File!", Path)
|
||||
Throw New ZUGFeRDExecption(ErrorType.NoZugferd, "Datei ist keine ZUGFeRD Datei.")
|
||||
End If
|
||||
|
||||
Try
|
||||
oXmlDocument = New XPathDocument(oTempFile)
|
||||
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
Throw ex
|
||||
End Try
|
||||
|
||||
Return oXmlDocument
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Validates a ZUGFeRD File and extracts the XML Document from it
|
||||
''' </summary>
|
||||
''' <param name="Stream"></param>
|
||||
''' <exception cref="ZUGFeRDExecption"></exception>
|
||||
''' <returns></returns>
|
||||
Public Function ValidateZUGFeRDFileWithGDPicture(Stream As Stream) As XPathDocument
|
||||
Dim oEmbedExtractor = New PDFEmbeds(_logConfig)
|
||||
Dim oAllowedExtensions = New List(Of String) From {"xml"}
|
||||
|
||||
Reference in New Issue
Block a user