[csv2img]: Customise colours and size of PDF
infinitepower18 opened this issue Β· comments
What is your new feature?
Hi, thanks for this package. I have tried it out with my app as it currently has a CSV export feature and also wanted to include the ability to export to PDF. This seems to do the job but have one request. Is it possible to customise the colours of the columns? I rather not have any colours and just a black font.
I am also looking for a way to customise the page size such as A4, letter rather than the size being just the table size.
It will be great if you can add these features. Thank you π
@infinitepower18
Thank you for your nice suggestion.
I linked 2 PRs which address this issue.
Could you take a look at them and try it on your application?
Sorry that I couldn't prepare well-documented codes but please update your codes base on the following sample codes. π
- how to set font color:
let exportable = try await csv.generate(
fontSize: 12,
exportType: exportType,
style: .init(color: NSColor.systemPink.cgColor)
).base
- how to set pdf output size (NOTE:
fontSize
will be ignored when setpdfMetadata
):
await csv.update(
pdfMetadata: .init(
size: .a4,
orientation: .landscape
)
)
you can try it on v1.8.0!
absolutely! let me adress this later. π
Hi, I released v1.8.1 that fixes above issue. please check it from your side as well when you have spare time.