Skip to content

Is it still feasible to direct an internal link to a page that has not been created yet, without specifying the page number ? #729

Closed Answered by Lucas-C
nsimonovici asked this question in Q&A
Discussion options

You must be logged in to vote

Hi!

Thank you for reaching out @nsimonovici and welcome to the fpdf2 community 😊

What you describe is very strange and may be a bug...
FPDF.add_link() in the latest releases should be fully backward compatible with the earlier versions of fpdf2 and even PyFPDF.

We only added some extra features to it in v2.6.1.
Calling set_link() is simply now optional: whereas you previously had to call link = pdf.add_link() and pdf.set_link(link, page=2), you can now just make a single call link = pdf.add_link(page=2), if you know the target page number upfront.
But calling set_link() is still valid.

We have a set of unit tests regarding add_link() that ensure the same features still work as they used to:

Replies: 1 comment 10 replies

Comment options

You must be logged in to vote
10 replies
@Lucas-C
Comment options

@nsimonovici
Comment options

@Lucas-C
Comment options

@Lucas-C
Comment options

@nsimonovici
Comment options

Answer selected by nsimonovici
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants