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

[FEATURE] Add more presets and initializer for PageSize #535

Open
shion1305 opened this issue Nov 1, 2023 · 2 comments
Open

[FEATURE] Add more presets and initializer for PageSize #535

shion1305 opened this issue Nov 1, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@shion1305
Copy link

shion1305 commented Nov 1, 2023

I suggest these 2 points. (Sorry for my poor English.)

  • Adding more presets for PageSize
  • Adding Initializer for PageSize, like NewPageSizeMM(width int, height int)

Currently, the following preset of PageSize are available.

  • PageSizeA5
  • PageSizeA4
  • PageSizeA3
  • PageSizeLegal
  • PageSizeLetter
    Adding more presets would be useful for users like me.
    I suggest adding the following presets.
  • ISO/JIS B5, B4,B3
  • Business Card Sizes (JIS: 91mmx55mm, US Standard: 3.5inchx2inch)

Also, I suggest adding an initializer for PageSize.
Currently, there are no initializers available for PageSize,
it is a kind of confusing figuring out how to use custom PageSize.
Adding an initializer would provide library users with some level of convenience.

Copy link

github-actions bot commented Nov 1, 2023

Welcome! Thanks for posting your first issue. The way things work here is that while customer issues are prioritized, other issues go into our backlog where they are assessed and fitted into the roadmap when suitable. If you need to get this done, consider buying a license which also enables you to use it in your commercial products. More information can be found on https://unidoc.io/

@sampila
Copy link
Collaborator

sampila commented Nov 1, 2023

Hi @shion1305,

Thanks for the suggestions, we will considering your feedback.
Currently to sets the custom page size should be easy, like if you want to set the page size to US Standard: 3.5inchx2inch, you can follow this line of code below

c := creator.New()

...
pageSizeUSStrandard := creator.PageSize{3.5 * creator.PPI, 2 * creator.PPI}

c.SetPageSize(pageSizeUSStrandard)

Our API references can be seen on https://apidocs.unidoc.io/unipdf/v3.39.0

Best regards,
Alip

@sampila sampila added the enhancement New feature or request label Nov 1, 2023
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