The Erech Shai (Mahadurah Basra, Hilchos Ribbis) writes very strongly against those who bring out seforim and print the names of the people who lent the money to help with the printing costs at the front of the sefer. Although letzorech mitzvah [for a mitzvah purpose] we are more lenient, this is only before one has fulfilled a mitzvah, after one has done the mitzvah, however, then any form of ribbis is prohibited. However, the Darkei Teshuvah (160:88) quotes the sefer Marbeh Torah who suggests that even once the money has been borrowed it is still considered letzorech mitzvah as people will learn to do the same thing and borrow money from people and also bring out seforim. However, the Darkei Teshuvah concludes: If one is bringing out a sefer to make money, and not solely for the purpose of spreading Torah, then it’s obvious that it’s forbidden to print names of those who lent money at the front.
R’ Moshe (Igros Moshe, Yoreh Deah 1:80) writes: It’s forbidden to write and print that one is thanking so and so for lending money, however, one can write in a passive way that so and so lent money. Certainly, it’s permissible to publicize how so and so lent x amount of money, even though the lender will benefit from this, as it’s a mitzvah to publicize those who do mitzvos, unless they are particular that their names aren’t publicized. Therefore, one may write: “Great berachah is given to ploni [so and so] who donated generously and lent x amount of money towards the printing of this sefer”.
However, some raise issue with this as well, as even if there may be a mitzvah to publicize those who fulfill mitzvos, in the end of the day the lender benefits from this, and this is the main intention of the one bringing out the sefer. However, if the lender has already been paid back, then certainly it’s ok to write such a message.
They bring from R’ Elyashiv that one shouldn’t write words of praise and thanks in the sefer for one who lent money to help with printing costs, however, once the lender had been paid back one may do so. However, even then, the one bringing out the sefer shouldn’t mention that the reason so and so is being mentioned is because he lent money. (Kuntros Dinei Ribbis, Kollel Avreichim, Rechovot sif 29).