Skip to content

Commit

Permalink
Updates for Aspose.Words for .NET 20.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Muzammil-khan committed Jan 10, 2020
1 parent ec3de1c commit c1b5a25
Show file tree
Hide file tree
Showing 16 changed files with 56 additions and 14 deletions.
16 changes: 8 additions & 8 deletions Examples/CSharp/CSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@
<Reference Include="Aspose.BarCode, Version=19.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56, processorArchitecture=MSIL">
<HintPath>..\packages\Aspose.BarCode.19.12.0\lib\net45\Aspose.BarCode.dll</HintPath>
</Reference>
<Reference Include="Aspose.Email, Version=19.11.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56, processorArchitecture=MSIL">
<HintPath>..\packages\Aspose.Email.19.11.0\lib\net40\Aspose.Email.dll</HintPath>
<Reference Include="Aspose.Email, Version=19.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56, processorArchitecture=MSIL">
<HintPath>..\packages\Aspose.Email.19.12.0\lib\net40\Aspose.Email.dll</HintPath>
</Reference>
<Reference Include="Aspose.Words, Version=19.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56, processorArchitecture=MSIL">
<HintPath>..\packages\Aspose.Words.19.12.0\lib\net40\Aspose.Words.dll</HintPath>
<Reference Include="Aspose.Words, Version=20.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56, processorArchitecture=MSIL">
<HintPath>..\packages\Aspose.Words.20.1.0\lib\net40\Aspose.Words.dll</HintPath>
</Reference>
<Reference Include="Aspose.Words.Shaping.HarfBuzz, Version=19.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56, processorArchitecture=MSIL">
<HintPath>..\packages\Aspose.Words.Shaping.HarfBuzz.19.12.0\lib\net40\Aspose.Words.Shaping.HarfBuzz.dll</HintPath>
<Reference Include="Aspose.Words.Shaping.HarfBuzz, Version=20.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56, processorArchitecture=MSIL">
<HintPath>..\packages\Aspose.Words.Shaping.HarfBuzz.20.1.0\lib\net40\Aspose.Words.Shaping.HarfBuzz.dll</HintPath>
</Reference>
<Reference Include="SkiaSharp, Version=1.68.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<HintPath>..\packages\SkiaSharp.1.68.1\lib\net45\SkiaSharp.dll</HintPath>
Expand Down Expand Up @@ -511,9 +511,9 @@
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\SkiaSharp.1.68.0\build\net45\SkiaSharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\SkiaSharp.1.68.0\build\net45\SkiaSharp.targets'))" />
<Error Condition="!Exists('..\packages\Aspose.Words.Shaping.HarfBuzz.19.12.0\build\net20\Aspose.Words.Shaping.HarfBuzz.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Aspose.Words.Shaping.HarfBuzz.19.12.0\build\net20\Aspose.Words.Shaping.HarfBuzz.targets'))" />
<Error Condition="!Exists('..\packages\Aspose.Words.Shaping.HarfBuzz.20.1.0\build\net20\Aspose.Words.Shaping.HarfBuzz.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Aspose.Words.Shaping.HarfBuzz.20.1.0\build\net20\Aspose.Words.Shaping.HarfBuzz.targets'))" />
</Target>
<Import Project="..\packages\Aspose.Words.Shaping.HarfBuzz.19.12.0\build\net20\Aspose.Words.Shaping.HarfBuzz.targets" Condition="Exists('..\packages\Aspose.Words.Shaping.HarfBuzz.19.12.0\build\net20\Aspose.Words.Shaping.HarfBuzz.targets')" />
<Import Project="..\packages\Aspose.Words.Shaping.HarfBuzz.20.1.0\build\net20\Aspose.Words.Shaping.HarfBuzz.targets" Condition="Exists('..\packages\Aspose.Words.Shaping.HarfBuzz.20.1.0\build\net20\Aspose.Words.Shaping.HarfBuzz.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
15 changes: 15 additions & 0 deletions Examples/CSharp/Programming-Documents/Shapes/WorkingWithShapes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public static void Run()
GetActualShapeBoundsPoints(dataDir);
SpecifyVerticalAnchor(dataDir);
DetectSmartArtShape(dataDir);
InsertOLEObjectAsIcon(dataDir);
}

public static void InsertShapeUsingDocumentBuilder(string dataDir)
Expand Down Expand Up @@ -169,5 +170,19 @@ public static void DetectSmartArtShape(string dataDir)
Console.WriteLine("The document has {0} shapes with SmartArt.", count);
// ExEnd:DetectSmartArtShape
}

public static void InsertOLEObjectAsIcon(string dataDir)
{
// ExStart:InsertOLEObjectAsIcon
Document doc = new Document();

DocumentBuilder builder = new DocumentBuilder(doc);
Shape shape = builder.InsertOleObjectAsIcon(dataDir + "embedded.xlsx", false, dataDir + "icon.ico", "My embedded file");

doc.Save(dataDir + "EmbeddeWithIcon_out.docx");

Console.WriteLine("The document has been saved with OLE Object as an Icon.");
// ExEnd:InsertOLEObjectAsIcon
}
}
}
25 changes: 24 additions & 1 deletion Examples/CSharp/Programming-Documents/Tables/TablePosition.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Aspose.Words.Tables;
using Aspose.Words.Drawing;
using Aspose.Words.Tables;
using System;
using System.Collections.Generic;
using System.Linq;
Expand All @@ -15,6 +16,7 @@ public static void Run()
string dataDir = RunExamples.GetDataDir_WorkingWithTables();
GetTablePosition(dataDir);
GetFloatingTablePosition(dataDir);
SetFloatingTablePosition(dataDir);
}

private static void GetTablePosition(string dataDir)
Expand Down Expand Up @@ -53,12 +55,33 @@ private static void GetFloatingTablePosition(string dataDir)
Console.WriteLine(table.AbsoluteHorizontalDistance);
Console.WriteLine(table.AbsoluteVerticalDistance);
Console.WriteLine(table.AllowOverlap);
Console.WriteLine(table.AbsoluteHorizontalDistance);
Console.WriteLine(table.RelativeVerticalAlignment);
Console.WriteLine("..............................");
}
}

// ExEnd:GetFloatingTablePosition
Console.WriteLine("\nGet the Table position successfully.");
}

private static void SetFloatingTablePosition(string dataDir)
{
// ExStart:SetFloatingTablePosition
Document doc = new Document(dataDir + "FloatingTablePosition.docx");

Table table = doc.FirstSection.Body.Tables[0];

// sets absolute table horizontal position at 10pt.
table.AbsoluteHorizontalDistance = 10;

// sets vertical table position to center of entity specified by Table.VerticalAnchor.
table.RelativeVerticalAlignment = VerticalAlignment.Center;

// Save the document to disk.
doc.Save(dataDir + "Table.SetFloatingTablePosition.docx");
// ExEnd:SetFloatingTablePosition
Console.WriteLine("\nSet the Table position successfully.");
}
}
}
4 changes: 2 additions & 2 deletions Examples/CSharp/RunExamples.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public static void Main()

//// Shapes
//// =====================================================
// WorkingWithShapes.Run();
WorkingWithShapes.Run();

//// Comments
//// =====================================================
Expand Down Expand Up @@ -194,7 +194,7 @@ public static void Main()
// DocumentBuilderInsertElements.Run();
// DocumentBuilderSetFormatting.Run();
// DocumentBuilderMovingCursor.Run();
ExtractTableOfContents.Run();
// ExtractTableOfContents.Run();
// ExtractTextOnly.Run();
// InsertDoc.Run();
// DocumentBuilderInsertTOC.Run();
Expand Down
4 changes: 4 additions & 0 deletions Examples/CSharp/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
<assemblyIdentity name="Aspose.Words" publicKeyToken="716fcc553a201e56" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-19.12.0.0" newVersion="19.12.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
6 changes: 3 additions & 3 deletions Examples/CSharp/packages.config
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Aspose.BarCode" version="19.12.0" targetFramework="net472" />
<package id="Aspose.Email" version="19.11.0" targetFramework="net472" />
<package id="Aspose.Words" version="19.12.0" targetFramework="net472" />
<package id="Aspose.Words.Shaping.HarfBuzz" version="19.12.0" targetFramework="net472" />
<package id="Aspose.Email" version="19.12.0" targetFramework="net472" />
<package id="Aspose.Words" version="20.1.0" targetFramework="net472" />
<package id="Aspose.Words.Shaping.HarfBuzz" version="20.1.0" targetFramework="net472" />
<package id="SkiaSharp" version="1.68.0" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.6.0-preview.18571.3" targetFramework="net472" />
<package id="System.Text.Encoding.CodePages" version="4.6.0-preview.18571.3" targetFramework="net472" />
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Examples/Data/Programming-Documents/WebExtensions/output.docx
Binary file not shown.

0 comments on commit c1b5a25

Please sign in to comment.