[Feature request] Setting the author in the PDF file via properties file
oova opened this issue · 5 comments
When I append a ZUGFeRD invoice to an existing PDF, the author in the PDF is set to my system user name. I can change the author name by calling
System.setProperty("io.konik.carriage.pdf.author", "My Author Name")
in my code. In addition to that, I would like to be able to set the author name in Konik's property file as follows:
io.konik.carriage.pdf.author=My Author Name
Yes this would be possible. But pull requests are also welcome :)
There is a Configuration.java class in konik the can be used equally for pdfbox carriage.
OK, I would like to make a pull request (finally). Before I do that, though, I would like to make sure to not bother you with useless changes, so let me summarize what I think needs to be done after a first code inspection:
- Copy the
Configuration
class from the konik project to the pdfbox-carriage project. - Change the "io.konik" string in the
overwriteWithSystemProperties
method to "io.konik.carriage.pdf". - Change the
getAuthor()
method in thePDFBoxInvoiceAppender
class to returnConfiguration.INSTANCE.getProperty("io.konik.carriage.pdf.author", defaultAuthor);
wheredefaultAuthor
is computed using the existing code, i.e., use the corresponding system property if not null, otherwise use the user name.
Is that it? Anything I got wrong or overlooked?
Exactly that is correct. You can make your contribution and we look together at it and correct it if needed.
Now that the changes have been merged to the pdfbox-carriage project, would it be a good idea to update the docs in the website project as well? The new property could be included in the 3.Configuration.adoc
document.
an update would be a good idea but IMHO not mandatory at the moment.