kz.greetgo.msoffice.xlsx.gen.PageSetup Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of greetgo.msoffice Show documentation
Show all versions of greetgo.msoffice Show documentation
greetgo library to generate or parse MS Office files
package kz.greetgo.msoffice.xlsx.gen;
import java.io.PrintStream;
public class PageSetup {
private Integer fitToWidth;
private Integer fitToHeight;
private Orientation orientation = Orientation.PORTRAIT;
private PaperSize paperSize;
public enum Orientation {
PORTRAIT, //
LANDSCAPE
}
public enum PaperSize {
A4(9), //
A5(11), //
A6(70), //
Legal(5), //
Executive(7), //
B5_JIS(13), //
Letter(-1);
private int code;
PaperSize(int code) {
this.code = code;
}
}
public void setFitToWidth(Integer fitToWidth) {
this.fitToWidth = fitToWidth;
}
public void setFitToHeight(Integer fitToHeight) {
this.fitToHeight = fitToHeight;
}
public void setOrientation(Orientation orientation) {
this.orientation = orientation;
}
public void setPaperSize(PaperSize paperSize) {
if (paperSize == PaperSize.Letter) {
this.paperSize = null;
return;
}
this.paperSize = paperSize;
}
boolean printHeader(PrintStream out) {
if (fitToWidth == null && fitToHeight == null) return false;
out.append("");
return true;
}
void print(PrintStream out) {
StringBuffer sb = new StringBuffer();
sb.append(" ");
out.println(sb.toString());
}
}