Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[csv2img]: Customise colours and size of PDF #43

Open
infinitepower18 opened this issue Dec 2, 2023 · 6 comments
Open

[csv2img]: Customise colours and size of PDF #43

infinitepower18 opened this issue Dec 2, 2023 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@infinitepower18
Copy link
Contributor

infinitepower18 commented Dec 2, 2023

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 infinitepower18 added the enhancement New feature or request label Dec 2, 2023
@infinitepower18 infinitepower18 changed the title [csv2img]: Customise colours of PDF [csv2img]: Customise colours and size of PDF Dec 2, 2023
@fummicc1
Copy link
Owner

fummicc1 commented Dec 3, 2023

@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 set pdfMetadata):
        await csv.update(
            pdfMetadata: .init(
                size: .a4,
                orientation: .landscape
            )
        )

@fummicc1
Copy link
Owner

fummicc1 commented Dec 3, 2023

you can try it on v1.8.0!

https://github.com/fummicc1/csv2img/releases/tag/1.8.0

@infinitepower18
Copy link
Contributor Author

infinitepower18 commented Dec 3, 2023

Hi, just gave it a try, looks good but I would prefer not to have the cells stretched out. Currently it looks like this:

Screenshot

Is it possible to have something like this? WIth table alignment starting from top left

screenshot2

@fummicc1
Copy link
Owner

fummicc1 commented Dec 3, 2023

absolutely! let me adress this later. 🙏

@fummicc1
Copy link
Owner

fummicc1 commented Dec 5, 2023

Hi, I released v1.8.1 that fixes above issue. please check it from your side as well when you have spare time.

@infinitepower18
Copy link
Contributor Author

infinitepower18 commented Dec 5, 2023

Only issue now is the last column looking a bit weird. Other than that, it's all good 👍

Untitled

Also I'm not sure why my note has the quotation marks, the original CSV output doesn't do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants