Skip to content

Links breaks when use addPage with another size #2801

Open
@MarceloZapatta

Description

@MarceloZapatta

Hi!

I'm facing an issue, links breaks when .addPage() with another format than the initial size, apparently the position of the link became incorrect.

Reproduce:

  • Start new doc with an specific size
  • Put some link anywhere in the first page
  • addPage() with an different size
  • The link inserted in the first page doesn't respect anymore the position passed.

Notice that this occurs with textWithLink and also link(). If the addPage() has the same size of initial format links work's just fine. I made an fiddle to help:

Works:
https://jsfiddle.net/MarceloZapatta/don4hqtj/

Breaks:
https://jsfiddle.net/fL403sja/2/

Activity

HackbrettXXX

HackbrettXXX commented on Jul 6, 2020

@HackbrettXXX
Collaborator

Yes, that's a bug. The links are written when the pages are finalized. Here the getHorizontal/VerticalCoordinateString functions are no longer valid (they use the dimensions of the last active page). The final bounds need to be stored when the link function is executed.

rahil1304

rahil1304 commented on Oct 3, 2020

@rahil1304

Hey
I would love to work on this issue. Could you please provide some more information on it?

HackbrettXXX

HackbrettXXX commented on Oct 5, 2020

@HackbrettXXX
Collaborator

Thanks! What additional information do you need exactly?

HackbrettXXX

HackbrettXXX commented on Oct 5, 2020

@HackbrettXXX
Collaborator

@rahil1304 I just realized that @MarceloZapatta already made a PR, sorry about that.

Setha77

Setha77 commented on Jan 2, 2024

@Setha77

@HackbrettXXX Hi this issue has been resolved since 3 years can you close it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @HackbrettXXX@rahil1304@MarceloZapatta@Setha77

      Issue actions

        Links breaks when use addPage with another size · Issue #2801 · parallax/jsPDF