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

Support for standard paper sizes (ISO 216) and orientation #31

Merged
merged 5 commits into from
Feb 20, 2016

Conversation

goeh
Copy link
Contributor

@goeh goeh commented Feb 10, 2016

Letter paper size was hard-coded in Document. I added support for specifying paper size and also added support for shortcuts to some common standard paper sizes like "Letter", "Legal", "A4", "A5", etc.

I also added support for specifying orientation "portrait" and "landscape".

Orientation and paper size is set on the Document instance so it's not possible to have some pages portrait and some landscape.

Tested ok with Word and PDF.

https://en.wikipedia.org/wiki/ISO_216

*
* @param arg a Dimension instance, a List<Number> [width, height] or the name of a standard paper size ("a4", "letter", "legal")
*/
void setSize(def arg) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great!

Can you change this to 3 individually overloaded setSize methods? setSize(Dimension size) setSize(List size) etc?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, sure! I'll fix it.

@craigburke
Copy link
Owner

Definitely a needed improvement. Thanks, man!

craigburke added a commit that referenced this pull request Feb 20, 2016
Support for standard paper sizes (ISO 216) and orientation
@craigburke craigburke merged commit bdec125 into craigburke:master Feb 20, 2016
@goeh goeh deleted the iso-216 branch February 24, 2016 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants