PyFPDF Library - DeprecationWarning: "dest" parameter is deprecated

I am a beginner at Python and have implemented the example on " Line breaks and colors" from PyFPDF. With a few tweaks I was able to get it to work.

https://pyfpdf.readthedocs.io/en/latest/Tutorial/index.html

However, I am getting this error:

DeprecationWarning: “dest” parameter is deprecated, unused and will soon be removed
pdf.output('‘tuto3.pdf’, ‘F’)

The document is created correct, but I’d just like the code to execute without any warnings. Any idea how to fix this line, so I don’t get the warning?

Thanks in advance for all responses.

It is the last line from this section:

pdf = PDF()
pdf.set_title(title)
pdf.set_author(‘Jules Verne’)
pdf.print_chapter(1, ‘A RUNAWAY REEF’, ‘20k_c1.txt’)
pdf.print_chapter(2, ‘THE PROS AND CONS’, ‘20k_c2.txt’)
pdf.output(‘tuto3.pdf’, ‘F’)

Use code-fences to show the code and the messages please.

```
print('code goes here')
```

I would look at the line the deprecation warning is for and check the docs for a dest param.
Then you can figure out how to not pass it in.

Sorry, it was my first post, so was not aware of how to do this. I will keep it mind for the future.

I don’t see anything relevant in the documentation for the library.

See fpdf API documentation.

You pass 'F' as the second parameter dest. Just remove that: pdf.output(‘tuto3.pdf’)

Thank you - it worked. I didn’t understand that no parameters was needed when I looked at the documentation.