from ironpdf import * # Para NUEVOS documentos PDF utilice PdfPaperOrientation # PdfPaperOrientation: Para elegir la orientación horizontal o vertical en un nuevo documento PDF. renderer = ChromePdfRenderer() renderer.RenderingOptions.PaperOrientation = PdfPaperOrientation.Landscape new_pdf_from_html = renderer.RenderHtmlAsPdf("<h1> Hello World! </h1>") new_pdf_from_html_file = renderer.RenderHtmlFileAsPdf("example.html") new_pdf_from_url = renderer.RenderUrlAsPdf("https://ironpdf.com") # Para PDF EXISTENTES utilice PageRotation # Rotación de página: Para rotar una página PDF y todo su contenido existing_pdf = PdfDocument.FromFile("old_report.pdf") # Obtener valor de rotación get_rotation_first_page = existing_pdf.Pages[0].PageRotation # Girar la página especificada existing_pdf.SetPageRotation(PageIndex=0, Rotation=PdfPageRotation.Clockwise90) # Girar TODAS las páginas existing_pdf.SetAllPageRotations(PdfPageRotation.Clockwise270)