Skip to content

Commit

Permalink
Added HelloWorld example
Browse files Browse the repository at this point in the history
  • Loading branch information
falleretic committed Dec 5, 2023
1 parent 2ff10d2 commit cb7c700
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Examples/ApiExamples/ApiExamples/ApiExamples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@

<ItemGroup>
<PackageReference Include="Aspose.BarCode" Version="23.10.0" />
<PackageReference Include="Aspose.Page" Version="23.10.0" />
<PackageReference Include="Aspose.PDF" Version="23.11.0" />
<PackageReference Include="Aspose.Words" Version="23.11.0" />
<PackageReference Include="Aspose.Page" Version="23.11.0" />
<PackageReference Include="Aspose.PDF" Version="23.11.1" />
<PackageReference Include="Aspose.Words" Version="23.12.0" />
<PackageReference Include="Aspose.Words.Shaping.HarfBuzz" Version="23.11.0" />
<PackageReference Include="BouncyCastle.Cryptography" Version="2.2.1" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
Expand Down
28 changes: 28 additions & 0 deletions Examples/DocsExamples/DocsExamples/Getting started/Hello world.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Aspose.Words;
using NUnit.Framework;

namespace DocsExamples.Getting_started
{
public class Hello_world : DocsExamplesBase
{
[Test]
public void HelloWorld()
{
//ExStart:HelloWorld
//GistDesc:Getting started example
Document docA = new Document();
DocumentBuilder builder = new DocumentBuilder(docA);

// Insert text to the document start.
builder.MoveToDocumentStart();
builder.Write("First Hello World paragraph");

Document docB = new Document(MyDir + "Document.docx");
// Add document B to the and of document A, preserving document B formatting.
docA.AppendDocument(docB, ImportFormatMode.KeepSourceFormatting);

docA.Save(ArtifactsDir + "C:\\Temp\\output_AB.pdf");
//ExEnd:HelloWorld
}
}
}

0 comments on commit cb7c700

Please sign in to comment.