Add custom button

Hello there,
I currently try to add a button to the “mocard.php” to create a label with a QR-code for the site of the MO I am currently on. To add it into the source code was not that hard (without functionality), but I want to try it via a modul.
Problem is I can’t seem to figure out how add the button via a hook. The wiki site didn’t give me a clear enough idea to accomplish that.
Do you guys have to an idea where I can find inspiration to accomplish it, so the button is added in the “mocard.php”?
Hopefully you can help me in finding a tutorial / modul to broaden my understanding.

Kind regards,
RPBTworker

I found out how I add a button, even though the functionality part is not working yet.
Had to look in the source code for the executeHook({hookName}). In my example it was the hookName “addMoreActionsButtons”.
Afterwards I just to had to add the following code for the if-clause: print '<a class="butAction" href="/custom/molabelmaker/class/generate_output.php">Create Label</a>'
Still struggling with the href, because when pressing this “Link” I get different errors, because I am no PHP pro.

Ok, right now I use the addMoreActionsButtons method in my “actions_molabelmaker.class.php” to add a “Link” that sends my to another class.php file were I try to access my “labelPrint.class.php”.
In the lablPrint file I want to create, design and output my label in a format that befits our label printer. Problem is now: the dolibarr functions and constants are not recognized!
I mean stuff like dol_include_once(…) or pdf_getInstance(…). I don’t know why or how to fix that. Other modules from the dolistore, just use them or I can’t figure out what they made different so the class.php file can use dolibarr code without errors.
Would love advice, if anyone has some.
Pics of my code currently, if wanted:
actions_molabelmaker.class.php

labelPrinter.class.php

genrate_output..class.php