Skip to content

Commit 5f0fd02

Browse files
committed
adds note about Umbraco
1 parent 8376881 commit 5f0fd02

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Diff for: README.md

+22
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,27 @@ image.SaveAsPng("document.png");
3232
```
3333
More info <https://docs.sixlabors.com/articles/imagesharp/configuration.html>
3434

35+
## Usage in Umbraco
36+
37+
To use in Umbraco, you must inject the configuration in an appropriate manor, eg. in a Composer.
38+
39+
```
40+
using Umbraco.Cms.Core.Composing;
41+
42+
namespace MyUmbracoProject;
43+
44+
public class PdfFormatComposer : IComposer
45+
{
46+
public void Compose(IUmbracoBuilder builder)
47+
{
48+
var config = SixLabors.ImageSharp.Configuration.Default.Clone();
49+
config.Configure(new ImageSharpCommunity.Formats.Pdf.PdfConfigurationModule());
50+
}
51+
}
52+
53+
```
54+
55+
This will be picked up by Umbraco when starting the website, and adds the necessary configuration.
56+
3557
## License
3658
[MIT](LICENSE)

0 commit comments

Comments
 (0)