Skip to content

Commit

Permalink
Solution to reproduce the bug including the PDF
Browse files Browse the repository at this point in the history
  • Loading branch information
Uli-Armbruster committed May 23, 2019
1 parent 7eeba65 commit 1caed02
Show file tree
Hide file tree
Showing 7 changed files with 145 additions and 0 deletions.
6 changes: 6 additions & 0 deletions App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
62 changes: 62 additions & 0 deletions IronPdf_turn180degree_FormatBug.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{53D8BFC3-4D33-4C51-BA1C-DA92D05177A4}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>IronPdf_turn180degree_FormatBug</RootNamespace>
<AssemblyName>IronPdf_turn180degree_FormatBug</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="IronPdf, Version=5.2.0.22321, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\IronPdf.5.2.0.1\lib\net40\IronPdf.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
<None Include="test_formula.pdf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
6 changes: 6 additions & 0 deletions IronPdf_turn180degree_FormatBug.csproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView>
</PropertyGroup>
</Project>
25 changes: 25 additions & 0 deletions IronPdf_turn180degree_FormatBug.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.572
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IronPdf_turn180degree_FormatBug", "IronPdf_turn180degree_FormatBug.csproj", "{53D8BFC3-4D33-4C51-BA1C-DA92D05177A4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{53D8BFC3-4D33-4C51-BA1C-DA92D05177A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{53D8BFC3-4D33-4C51-BA1C-DA92D05177A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{53D8BFC3-4D33-4C51-BA1C-DA92D05177A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{53D8BFC3-4D33-4C51-BA1C-DA92D05177A4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B7AB5CB2-8045-4A33-8C1E-63333E2BFA5A}
EndGlobalSection
EndGlobal
42 changes: 42 additions & 0 deletions Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using System.IO;
using System.Reflection;
using IronPdf;

namespace IronPdf_turn180degree_FormatBug
{
internal class Program
{
private static void Main()
{
var filenamePattern = new FileInfo(Assembly.GetExecutingAssembly().Location).Directory +
@"\test_formula#rotation#.pdf";
var rotated000 = filenamePattern.Replace("#rotation#", string.Empty);
var rotated090 = filenamePattern.Replace("#rotation#", "_090");
var rotated180 = filenamePattern.Replace("#rotation#", "_180");
var rotated270 = filenamePattern.Replace("#rotation#", "_270");
var rotated360 = filenamePattern.Replace("#rotation#", "_360");

var pdf = new PdfDocument(rotated000);
pdf.RotateAllPages(90); //90
while (!pdf.Stream.CanWrite) continue;

pdf.SaveAs(rotated090); //incorrect
pdf.RotateAllPages(90); //180
while (!pdf.Stream.CanWrite) continue;

pdf.SaveAs(rotated180); //correct


pdf.RotateAllPages(90); //270
while (!pdf.Stream.CanWrite) continue;

pdf.SaveAs(rotated270); //incorrect


pdf.RotateAllPages(90); //360
while (!pdf.Stream.CanWrite) continue;

pdf.SaveAs(rotated360); //correct
}
}
}
4 changes: 4 additions & 0 deletions packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="IronPdf" version="5.2.0.1" targetFramework="net472" />
</packages>
Binary file added test_formula.pdf
Binary file not shown.

0 comments on commit 1caed02

Please sign in to comment.