Añadir Efecto de Reflexión

Creación de texto con efecto de reflejo

El efecto de reflejo agrega una imagen reflejada debajo del texto, creando una apariencia pulida y moderna. 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 crear reflejos personalizados, se pueden ajustar propiedades como la distancia, el desenfoque y la transparencia para perfeccionar la apariencia.

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 último, agregue el párrafo al documento para aplicar el efecto de reflejo.

Explicación del código

Creemos un nuevo documento de Word y agreguemos texto con un efecto de reflexión. 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. Esto sigue la jerarquía del documento: Documento → Párrafo → Ejecutar → Contenido de texto. Finalmente, el documento se guarda.

Explore los elementos del documento en los tutoriales de IronWord.

¿Listo para empezar?
Nuget Descargas 35,581 | Versión: 2026.3 recién lanzado
Still Scrolling Icon

¿Aún desplazándote?

¿Quieres una prueba rápida? PM > Install-Package IronWord
ejecuta una muestra observa cómo tus datos se convierten en un documento de Word.