Funktion zur Aufhebung der Formfelder im Signiervorgang - Class EnvelopeEditorController, Class FlattenFormFields
This commit is contained in:
32
EnvelopeGenerator.Form/Helper/FlattenFormFields.vb
Normal file
32
EnvelopeGenerator.Form/Helper/FlattenFormFields.vb
Normal file
@@ -0,0 +1,32 @@
|
||||
Imports System.IO
|
||||
Imports GdPicture14
|
||||
|
||||
Public Class FlattenFormFields
|
||||
|
||||
Public Shared Function FlattenFormFields(pFilePath As String) As String
|
||||
|
||||
Dim oFolder As String = Path.GetDirectoryName(pFilePath)
|
||||
|
||||
Dim gdpicturePdf As GdPicturePDF = New GdPicturePDF()
|
||||
|
||||
Dim status As GdPictureStatus = gdpicturePdf.LoadFromFile(pFilePath, True)
|
||||
If status = GdPictureStatus.OK Then
|
||||
|
||||
Dim oFormFieldsCount = gdpicturePdf.GetFormFieldsCount()
|
||||
If oFormFieldsCount > 0 Then
|
||||
gdpicturePdf.FlattenFormFields()
|
||||
|
||||
Dim newFilesPath As String = Path.Combine(oFolder, "InputFieldsFlattend_" & Path.GetFileName(pFilePath))
|
||||
If gdpicturePdf.SaveToFile(newFilesPath) = GdPictureStatus.OK Then
|
||||
Return newFilesPath
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Return pFilePath
|
||||
|
||||
End Function
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user