Funktion zur Aufhebung der Formfelder im Signiervorgang - Class EnvelopeEditorController, Class FlattenFormFields
This commit is contained in:
parent
3c5f5cb5f5
commit
ae31b1da0f
@ -166,7 +166,7 @@ Public Class EnvelopeEditorController
|
||||
DocumentRotationChanged()
|
||||
Logger.Info("PageRotation has been reseted to 0.")
|
||||
End If
|
||||
GdPicturePDF.FlattenFormFields()
|
||||
oFixedPath = FlattenFormFields.FlattenFormFields(oFixedPath)
|
||||
Dim oFileInfo = New FileInfo(oFixedPath)
|
||||
Dim oTempFiles As New TempFiles(State.LogConfig)
|
||||
Dim oTempFilePath = Path.Combine(oTempFiles._TempPath, Guid.NewGuid().ToString + oFileInfo.Extension)
|
||||
|
||||
@ -369,6 +369,7 @@
|
||||
</Compile>
|
||||
<Compile Include="Helper\Encryption.vb" />
|
||||
<Compile Include="Helper\FixPageRotation.vb" />
|
||||
<Compile Include="Helper\FlattenFormFields.vb" />
|
||||
<Compile Include="Helper\RefreshHelper.vb" />
|
||||
<Compile Include="Helper\TempFiles.vb" />
|
||||
<Compile Include="Helper\Thumbnail.vb" />
|
||||
|
||||
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
|
||||
Loading…
x
Reference in New Issue
Block a user