If you have uniqe code (and more variable data like QR-codes and so on):
Make textbox with code in your PDF, make it Variable and name Data Set, save Variable library. Edit XML file in your text/XML editor, copy and paste
<v:sampleDataSet dataSetName="YourUniCode">. Fill corresponding fields.
You may have to create first file with codes and then use Find & Replace in your editor to surround code with XML tags. Then copypaste results in XML file.
Load your XML file (Variable library) into Illustrator.
Use script to export each dataset in separate PDF.
I have simple script on GitHub, you can adjust it to your specific needs.
If you have linear codes from
m (1 to 100) you can import your PDF into template page to InDesign, make your text box with page number, make 100 pages and print it.