Skip to content

Commit 02b1306

Browse files
authored
Merge pull request #1 from oicana/typst-0-14
Update to Typst 0.14 (C# integration 0.1.0-alpha.5)
2 parents 11fb5c7 + c59a475 commit 02b1306

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Oicana.Example.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
Uncomment below to use the local Oicana integration.
1414
This requires you to check out oicana next to this example repository.
1515
-->
16-
<!-- <DefineConstants>$(DefineConstants);USE_LOCAL_OICANA</DefineConstants>-->
16+
<!--<DefineConstants>$(DefineConstants);USE_LOCAL_OICANA</DefineConstants>-->
1717
</PropertyGroup>
1818

1919
<Choose>
@@ -24,7 +24,7 @@
2424
</When>
2525
<Otherwise>
2626
<ItemGroup>
27-
<PackageReference Include="Oicana" Version="0.1.0-alpha.3" />
27+
<PackageReference Include="Oicana" Version="0.1.0-alpha.5" />
2828
</ItemGroup>
2929
</Otherwise>
3030
</Choose>

Services/CertificateService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class CertificateService(IOicanaService oicanaService, ILogger<Certificat
3333
// We can use `TemplateJsonInput.From` here, because `CreateCertificate` serializes into a valid value for the certificate input
3434
// In a production system you most likely want separate types as API Model and for the input representation
3535
var input = TemplateJsonInput.From("certificate", request, new JsonSerializerOptions(JsonSerializerDefaults.Web));
36-
var result = await Task.Run<Stream?>(() => template.Compile([input], [], CompilationOptions.Pdf()));
36+
var result = await Task.Run<Stream?>(() => template.Compile([input], [], new CompilationOptions(CompilationMode.Production), ExportOptions.Pdf()));
3737
watch.Stop();
3838

3939
logger.LogInformation("Certificate generated in {ElapsedMilliseconds}ms", watch.ElapsedMilliseconds);

Services/TemplatingService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class TemplatingService(IOicanaService oicanaService, IStoredBlobService
1818
}
1919
var blobInputs = await LoadBlobInputs(storedBlobInputs);
2020

21-
return await Task.Run<Stream?>(() => template.Compile(jsonInput, blobInputs, CompilationOptions.Pdf()));
21+
return await Task.Run<Stream?>(() => template.Compile(jsonInput, blobInputs, new CompilationOptions(CompilationMode.Production), ExportOptions.Pdf()));
2222
}
2323

2424
/// <inheritdoc />
@@ -31,7 +31,7 @@ public class TemplatingService(IOicanaService oicanaService, IStoredBlobService
3131
}
3232
var blobInputs = await LoadBlobInputs(storedBlobInputs);
3333

34-
return await Task.Run<Stream?>(() => template.Compile(jsonInput, blobInputs, CompilationOptions.Png(1.0f)));
34+
return await Task.Run<Stream?>(() => template.Compile(jsonInput, blobInputs, new CompilationOptions(CompilationMode.Production), ExportOptions.Png(1.0f)));
3535
}
3636

3737
/// <inheritdoc />

0 commit comments

Comments
 (0)