Traducir objetos PDF en C# There are times when users need to move a particular text, image, or shape within a PDF to another location. With IronPDF, we offer ways for developers to directly access a PDF object and translate it using our library. Within this code example, we'll go through how you can translate objects with the PDF DOM easily with IronPDF. 5-Step Code to translate PDF Objects ChromePdfRenderer renderer = new ChromePdfRenderer(); PdfDocument pdf = renderer.RenderHtmlAsPdf("Test"); var objects = pdf.Pages.First().ObjectModel.TextObjects.First(); objects.Translate = new System.Drawing.PointF(100,-100); pdf.SaveAs("translated.pdf"); Code Explanation We first instantiate a ChromePdfRenderer and then call RenderHtmlAsPdf to render an HTML string into a PDF. After rendering the text, we then access the PDF DOM object collection. We get the first page using Pages.First, then access its ObjectModel to find the TextObjects collection. The TextObjects collection holds all TextObject instances within the PDF. We access the first element in this collection and assign it to the variable. After obtaining the first TextObject within the PDF (in our example, this would be the word "Test"), we then assign a new PointF(X, Y) to the Translate property. By assigning a new point, the position of the word shifts 100 points to the right and 100 points down along the X and Y axes. Finally, after the text has been moved, we utilize the SaveAs method to save the modified PDF. Discover How to Effortlessly Translate PDF DOM - Visit Our Guide Now! Ver en GitHub Código https://github.com/iron-software/IronPdf.Examples/tree/main/examples/translate-pdf-objects Descargar ZIP Tutorial Relacionado Guía de Cómo Hacer Relacionada Documentación de Clase Obtener Paquetes de Idiomas Descargar IronPDF DLL Reportar un problema en esta página ¿Listo para empezar? Nuget Descargas 16,133,208 | Versión: 2025.11 recién lanzado Descarga Gratis de NuGet Descargas totales: 16,133,208 Ver Licencias
Producto completamente funcional Obtén 30 días de producto completamente funcional.Instálalo y ejecútalo en minutos.
Soporte técnico 24/5 Acceso completo a nuestro equipo de soporte técnico durante tu prueba del producto
Producto completamente funcional Obtén 30 días de producto completamente funcional.Instálalo y ejecútalo en minutos.
Soporte técnico 24/5 Acceso completo a nuestro equipo de soporte técnico durante tu prueba del producto