Skip to content

Customizable zoom level on PdfWriter.add_named_destination() #3522

@andersonhc

Description

@andersonhc

Explanation

PdfWriter.add_named_destination() currently hardcodes the zoom mode to FitH (full width).
If a user wants to add a named destination with another zoom mode it's not possible.

Code Example

Adding a new parameter in add_named_destination(), defaulting to FitH would allow users to chose other values while being 100% backwards compatible.

Taking this code as an example: https://github.com/andersonhc/fpdf2-snippets/blob/main/create_table_of_contents/create_toc.py

We could use for full page zoom:

     writer.add_named_destination(destination_name, page_number=destination_page, type_fit= TypFitArguments.FIT)

Metadata

Metadata

Assignees

No one assigned

    Labels

    is-featureA feature requestworkflow-bookmarksFrom a users perspective, bookmarks is the affected feature/workflow

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions