Compare commits
4 Commits
bugfix/sig
...
115cb86968
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
115cb86968 | ||
|
|
4a898e40ac | ||
|
|
bdc0286253 | ||
|
|
8bdc305b82 |
@@ -156,11 +156,7 @@ Public Class EnvelopeEditorController
|
|||||||
|
|
||||||
Public Async Function CreateDocument(pDocumentFilePath As String) As Threading.Tasks.Task(Of EnvelopeDocument)
|
Public Async Function CreateDocument(pDocumentFilePath As String) As Threading.Tasks.Task(Of EnvelopeDocument)
|
||||||
Try
|
Try
|
||||||
Dim oFixedPath = FixPageRotation.FixPageRotation(pDocumentFilePath)
|
Dim oFileInfo = New FileInfo(pDocumentFilePath)
|
||||||
If oFixedPath <> pDocumentFilePath Then
|
|
||||||
Logger.Info("PageRotation has been reseted to 0.")
|
|
||||||
End If
|
|
||||||
Dim oFileInfo = New FileInfo(oFixedPath)
|
|
||||||
Dim oTempFiles As New TempFiles(State.LogConfig)
|
Dim oTempFiles As New TempFiles(State.LogConfig)
|
||||||
Dim oTempFilePath = Path.Combine(oTempFiles._TempPath, Guid.NewGuid().ToString + oFileInfo.Extension)
|
Dim oTempFilePath = Path.Combine(oTempFiles._TempPath, Guid.NewGuid().ToString + oFileInfo.Extension)
|
||||||
|
|
||||||
@@ -176,7 +172,7 @@ Public Class EnvelopeEditorController
|
|||||||
.FileNameOriginal = oFileInfo.Name,
|
.FileNameOriginal = oFileInfo.Name,
|
||||||
.Thumbnail = Thumbnail.GetThumbnailFromPDFFile(oTempFilePath),
|
.Thumbnail = Thumbnail.GetThumbnailFromPDFFile(oTempFilePath),
|
||||||
.PageCount = Thumbnail.GetPageCount(oTempFilePath),
|
.PageCount = Thumbnail.GetPageCount(oTempFilePath),
|
||||||
.Byte_Data = ReadFile(oFixedPath)
|
.Byte_Data = ReadFile(pDocumentFilePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
Return oDocument
|
Return oDocument
|
||||||
|
|||||||
@@ -362,7 +362,6 @@
|
|||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Helper\Encryption.vb" />
|
<Compile Include="Helper\Encryption.vb" />
|
||||||
<Compile Include="Helper\FixPageRotation.vb" />
|
|
||||||
<Compile Include="Helper\RefreshHelper.vb" />
|
<Compile Include="Helper\RefreshHelper.vb" />
|
||||||
<Compile Include="Helper\TempFiles.vb" />
|
<Compile Include="Helper\TempFiles.vb" />
|
||||||
<Compile Include="Helper\Thumbnail.vb" />
|
<Compile Include="Helper\Thumbnail.vb" />
|
||||||
|
|||||||
@@ -1,48 +0,0 @@
|
|||||||
Imports System.IO
|
|
||||||
Imports GdPicture14
|
|
||||||
|
|
||||||
Public Class FixPageRotation
|
|
||||||
''' <summary>
|
|
||||||
''' Checks if there are any rotations in the document. If so, normalizes the page rotation to 0 without affecting its visual appearance.
|
|
||||||
''' Creates and uses a new document with the corrected properties.
|
|
||||||
''' Fixes the issue of annotations being rotated to match the page's rotation.
|
|
||||||
''' </summary>
|
|
||||||
''' <param name="pFilePath"></param>
|
|
||||||
''' <returns></returns>
|
|
||||||
Public Shared Function FixPageRotation(pFilePath As String) As String
|
|
||||||
|
|
||||||
Dim oFolder As String = Path.GetDirectoryName(pFilePath)
|
|
||||||
Dim oChanged As Boolean = False
|
|
||||||
|
|
||||||
Using gdpicturePDF As New GdPicturePDF()
|
|
||||||
|
|
||||||
Dim status As GdPictureStatus = gdpicturePDF.LoadFromFile(pFilePath, True)
|
|
||||||
If status = GdPictureStatus.OK Then
|
|
||||||
|
|
||||||
Dim count As Integer = gdpicturePDF.GetPageCount()
|
|
||||||
For i As Integer = 1 To count
|
|
||||||
If gdpicturePDF.SelectPage(i) = GdPictureStatus.OK Then
|
|
||||||
Dim rotation As Integer = gdpicturePDF.GetPageRotation()
|
|
||||||
If rotation <> 0 Then
|
|
||||||
gdpicturePDF.NormalizePage()
|
|
||||||
oChanged = True
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
|
|
||||||
End If
|
|
||||||
|
|
||||||
If oChanged Then
|
|
||||||
Dim newFilesPath As String = Path.Combine(oFolder, "RotationFixed_" & Path.GetFileName(pFilePath))
|
|
||||||
If gdpicturePDF.SaveToFile(newFilesPath) = GdPictureStatus.OK Then
|
|
||||||
Return newFilesPath
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
End Using
|
|
||||||
|
|
||||||
Return pFilePath
|
|
||||||
|
|
||||||
End Function
|
|
||||||
|
|
||||||
End Class
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
<TargetFrameworks>net7.0;net8.0;net9.0</TargetFrameworks>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
<TargetFrameworks>net7.0;net8.0;net9.0</TargetFrameworks>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<PackageId>EnvelopeGenerator.Web</PackageId>
|
<PackageId>EnvelopeGenerator.Web</PackageId>
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
|
-->
|
||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<WebPublishMethod>Package</WebPublishMethod>
|
||||||
|
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||||
|
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||||
|
<SiteUrlToLaunchAfterPublish />
|
||||||
|
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
|
||||||
|
<ExcludeApp_Data>false</ExcludeApp_Data>
|
||||||
|
<ProjectGuid>5e0e17c0-ff5a-4246-bf87-1add85376a27</ProjectGuid>
|
||||||
|
<DesktopBuildPackageLocation>P:\Install .Net\0 DD - Smart UP\signFLOW\Web\net7\$(Version)\EnvelopeGenerator.Web.zip</DesktopBuildPackageLocation>
|
||||||
|
<PackageAsSingleFile>true</PackageAsSingleFile>
|
||||||
|
<DeployIisAppPath>EnvelopeGenerator</DeployIisAppPath>
|
||||||
|
<_TargetId>IISWebDeployPackage</_TargetId>
|
||||||
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
|
-->
|
||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<WebPublishMethod>Package</WebPublishMethod>
|
||||||
|
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||||
|
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||||
|
<SiteUrlToLaunchAfterPublish />
|
||||||
|
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
|
||||||
|
<ExcludeApp_Data>false</ExcludeApp_Data>
|
||||||
|
<ProjectGuid>5e0e17c0-ff5a-4246-bf87-1add85376a27</ProjectGuid>
|
||||||
|
<DesktopBuildPackageLocation>P:\Install .Net\0 DD - Smart UP\signFLOW\Web\net9\win64\$(Version)\EnvelopeGenerator.Web.zip</DesktopBuildPackageLocation>
|
||||||
|
<PackageAsSingleFile>true</PackageAsSingleFile>
|
||||||
|
<DeployIisAppPath>EnvelopeGenerator</DeployIisAppPath>
|
||||||
|
<_TargetId>IISWebDeployPackage</_TargetId>
|
||||||
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
|
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||||
|
<SelfContained>true</SelfContained>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
Reference in New Issue
Block a user