Adjuntar una portada When working with PDF documents, adding a cover page provides a method for increasing the visual appeal of the PDF itself. It gives developers like yourself a space to add branding to the PDF, or simply attract more readers with a cover page that stands out. IronPDF makes it easy to add cover pages to your PDFs in just a couple of lines of code, thanks to its merge tool. 5 Steps to Adding Cover Pages to Your PDFs For today's example, we will be converting an HTML string to PDF; however, you can load in an existing PDF document that contains the cover page you want to attach to your PDF file. To do this, we must create a new ChromePdfRenderer object. This class handles HTML to PDF conversion, allowing you to render pixel-perfect PDF documents from HTML, CSS, and JavaScript content. Then, we create our cover page by rendering our HTML string to PDF format using RenderHtmlAsPdf. If you're working with a pre-existing PDF document as your cover, you would need to load in your PDF using PdfDocument.FromFile. Next, we configure the renderer with custom rendering options. We set the first-page number to 2, which ensures that when we render our main PDF document, the page numbering will start at 2 instead of the default (1). Next, we need to render our main PDF. Here, we are rendering web content from a URL into a PDF document. At this point, we have two PDF objects, one containing our PDF cover and the second containing our PDF from the URL. Now, it's time to attach our cover page to our core PDF document. We can do this in just one easy line of code. InsertPdf(cover, 0) inserts the cover PDF at page index 0, which is the beginning of the PDF document. Now, the pdf object is one PDF document that contains the cover page and the URL content. Then, using SaveAs, we save the final merged PDF document to the specified file location. Learn to Create a Table of Contents in Your PDFs Ver en GitHub Código https://github.com/iron-software/IronPdf.Examples/tree/main/examples/pdf-cover-page 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,154,058 | Versión: 2025.11 recién lanzado Descarga Gratis de NuGet Descargas totales: 16,154,058 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