Adicionar efeito de reflexo

Criando texto com efeito de reflexo

O efeito de reflexo adiciona uma imagem espelhada abaixo do texto, criando uma aparência moderna e sofisticada. In IronWord, this effect is applied through the ReflectionEffect property of a TextEffect object, which can be customized or used with default settings.

To implement a reflection effect, create a TextStyle and configure its TextEffect property with a Reflection instance. The Reflection class supports default initialization, which applies standard reflection parameters suitable for most use cases. Para reflexos personalizados, propriedades como distância, desfoque e transparência podem ser ajustadas para refinar a aparência.

After defining the text style, create a Run containing your TextContent and assign the configured style to the run. Use AddChild to add the run to a paragraph, maintaining the proper document hierarchy of Document → Paragraph → Run → TextContent. Por fim, adicione o parágrafo ao documento para aplicar o efeito de reflexão.

Explicação do código

Vamos criar um novo documento do Word e adicionar texto com efeito de reflexo. Initially, a new WordDocument object named doc is created. A TextStyle object is then instantiated and configured to include a reflection effect by setting its TextEffect property to a new Reflection object.

To add the styled text with the reflection effect, a Paragraph is created, then a Run object is created containing TextContent with "Hello World". The TextStyle is assigned to the Run, applying the reflection effect. The Run is added to the Paragraph using AddChild, and the Paragraph is added to the document. Isso segue a hierarquia do documento: Documento → Parágrafo → Execução → Conteúdo do Texto. Finalmente, o documento foi salvo.

Explore os elementos do documento nos tutoriais do IronWord .

Pronto para começar?
Nuget Downloads 35,581 | Versão: 2026.3 acaba de ser lançado
Still Scrolling Icon

Ainda está rolando a tela?

Quer provas rápidas? PM > Install-Package IronWord
executar um exemplo Veja seus dados se transformarem em um documento do Word.