Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

ENH: Styler.to_pdf() and Styler.to_svg() #52455

Copy link
Copy link
Open
@janosh

Description

@janosh
Issue body actions

Feature Type

  • Adding new functionality to pandas

  • Changing existing functionality in pandas

  • Removing existing functionality in pandas

Problem Description

Styler already supports exporting to HTML. Wouldn't be a long shot from there to support exporting as SVG too which is accepted by many more programs like graphics editors and presentation software like PowerPoint and Keynote. The same is true for PDF. You can't drag and drop HTML into Keynote but you can PDFs.

Feature Description

styler.to_pdf("my-table.pdf")
styler.to_svg("my-table.svg")

Alternative Solutions

Most of the to_html kwargs readily apply to SVG so .svg export support could be incorporated into that method but should then be highlighted in the docs.

    @Substitution(buf=buffering_args, encoding=encoding_args)
    def to_html(
        self,
        buf: FilePath | WriteBuffer[str] | None = None,
        *,
        table_uuid: str | None = None,
        table_attributes: str | None = None,
        sparse_index: bool | None = None,
        sparse_columns: bool | None = None,
        bold_headers: bool = False,
        caption: str | None = None,
        max_rows: int | None = None,
        max_columns: int | None = None,
        encoding: str | None = None,
        doctype_html: bool = False,
        exclude_styles: bool = False,
        **kwargs,
    ) -> str | None:

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNeeds DiscussionRequires discussion from core team before further actionRequires discussion from core team before further actionStylerconditional formatting using DataFrame.styleconditional formatting using DataFrame.style

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.