com.ironsoftware.ironpdf.headerfooter.HeaderFooterOptions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ironpdf Show documentation
Show all versions of ironpdf Show documentation
IronPDF Java library offers an extensive compatibility range, making it a go-to solution for a wide array of developers. It fully supports JVM languages like Java, Scala, and Kotlin, making it incredibly versatile. This Java PDF library is also compatible with Java 8 and above, providing optimum performance across multiple platforms. It's been designed with a wide range of users in mind Here's a look at what it supports: JVM Languages: Java, Scala, Kotlin.Platforms: Java 8 and above.Operating Systems: Microsoft Windows, Linux, Docker, Azure, AWS.IDEs: Jetbrains IntelliJ IDEA, Eclipse. You can deploy IronPDF Java across various platforms, including Microsoft Windows, Linux, Docker, Azure, and AWS. It is also fully compatible with popular IDEs like Jetbrains IntelliJ IDEA and Eclipse, facilitating smooth project development and management. Your pom.xml file is essentially the backbone of your project when you're using Maven. It's here where you introduce new dependencies that you wish to include. To make IronPDF Java package a part of your Maven project, you simply need to add the following snippets to your pom.xml: Remember to replace '20xx.xx.xxxx' with the latest version of IronPDF. IronPDF Java simplifies the process of creating PDF files. Convert HTML files, HTML strings, or URLs directly to new PDF documents in a few lines of code. The variety of file formats it handles is vast, as it can even transform images into PDF documents and vice versa. Need to use base 64 encoding, base URLs, or custom file paths? No problem! IronPDF Java has got you coveredFor more detail about installing and using IronPDF Java. When you run your project for the first time post-integration, IronPDF's engine binaries will automatically be downloaded. The engine starts its journey when you call any IronPDF function for the first time and takes a breather when your application is either closed or enters an idle state. It is not an open source java PDF library but here's the best part - IronPDF Java is offering a 30-day free trial. So, why wait? Give it a go and boost your PDF operations today.
package com.ironsoftware.ironpdf.headerfooter;
import com.ironsoftware.ironpdf.render.CssMediaType;
/**
* Defines options for Headers and Footers applied to a {@link com.ironsoftware.ironpdf.PdfDocument} during rendering or at any other time.
* See: {@link HtmlHeaderFooter}
* See: {@link TextHeaderFooter}
* See: {@link com.ironsoftware.ironpdf.render.ChromePdfRenderOptions}
*/
public class HeaderFooterOptions {
/**
* The left margin of the header on the page; in millimeters. Default is 0mm.
*/
private int marginLeftMm = 0;
/**
* The right margin of the header on the page; in millimeters. Default is 0mm.
*/
private int marginRightMm = 0;
/**
* The top margin of the header on the page; in millimeters. Default is 0mm.
*/
private int marginTopMm = 0;
/**
* The bottom margin of the header on the page; in millimeters. Default is 0mm.
*/
private int marginBottomMm = 0;
/**
* First number used in {page} merge fields on the first page of the PDF. Subsequent page numbers will increment from this number. Default is 0.
*/
private int firstPageNumber = 1;
/**
* RenderPdfCssMediaType. Default is PRINT. This will be ignored if the header/footer is
* TextHeaderFooter.
*/
private CssMediaType renderPdfCssMediaType = CssMediaType.PRINT;
/**
* PdfTitle. Default is null.
*/
private String pdfTitle = null;
/**
* HtmlTitle. Default is null. This will be ignored if the header/footer is TextHeaderFooter.
*/
private String htmlTitle = null;
/**
* Instantiates a new Header footer options.
*/
public HeaderFooterOptions() {
}
/**
* Gets margin left mm. The left margin of the header on the page; in millimeters. Default is 0mm.
*
* @return the margin left mm
*/
public int getMarginLeftMm() {
return marginLeftMm;
}
/**
* Sets margin left mm. The left margin of the header on the page; in millimeters. Default is 0mm.
*
* @param marginLeftMm the margin left mm
*/
public void setMarginLeftMm(int marginLeftMm) {
this.marginLeftMm = marginLeftMm;
}
/**
* Gets margin right mm. The top margin of the header on the page; in millimeters. Default is 0mm.
*
* @return the margin right mm
*/
public int getMarginRightMm() {
return marginRightMm;
}
/**
* Sets margin right mm. The top margin of the header on the page; in millimeters. Default is 0mm.
*
* @param marginRightMm the margin right mm
*/
public void setMarginRightMm(int marginRightMm) {
this.marginRightMm = marginRightMm;
}
/**
* Gets margin top mm. The top margin of the header on the page; in millimeters. Default is 0mm.
*
* @return the margin top mm
*/
public int getMarginTopMm() {
return marginTopMm;
}
/**
* Sets margin top mm. The top margin of the header on the page; in millimeters. Default is 0mm.
*
* @param marginTopMm the margin top mm
*/
public void setMarginTopMm(int marginTopMm) {
this.marginTopMm = marginTopMm;
}
/**
* Gets margin bottom mm. The bottom margin of the header on the page; in millimeters. Default is 0mm.
*
* @return the margin bottom mm
*/
public int getMarginBottomMm() {
return marginBottomMm;
}
/**
* Sets margin bottom mm. The bottom margin of the header on the page; in millimeters. Default is 0mm.
*
* @param marginBottomMm the margin bottom mm
*/
public void setMarginBottomMm(int marginBottomMm) {
this.marginBottomMm = marginBottomMm;
}
/**
* Gets first page number.First number used in {page} merge fields on the first page of the PDF. Subsequent page numbers will increment from this number. Default is 0.
*
* @return the first page number
*/
public int getFirstPageNumber() {
return firstPageNumber;
}
/**
* Sets first page number. First number used in {page} merge fields on the first page of the PDF. Subsequent page numbers will increment from this number. Default is 0.
*
* @param firstPageNumber the first page number
*/
public void setFirstPageNumber(int firstPageNumber) {
this.firstPageNumber = firstPageNumber;
}
/**
* Gets render pdf css media type. RenderPdfCssMediaType, Default is PRINT. This will be ignored if the header/footer is
* TextHeaderFooter.
*
* @return the render pdf css media type
*/
public CssMediaType getRenderPdfCssMediaType() {
return renderPdfCssMediaType;
}
/**
* Sets render pdf css media type. RenderPdfCssMediaType, Default is PRINT. This will be ignored if the header/footer is
* TextHeaderFooter.
*
* @param renderPdfCssMediaType the render pdf css media type
*/
public void setRenderPdfCssMediaType(CssMediaType renderPdfCssMediaType) {
this.renderPdfCssMediaType = renderPdfCssMediaType;
}
/**
* Gets pdf title. Default is null.
*
* @return the pdf title
*/
public String getPdfTitle() {
return pdfTitle;
}
/**
* Sets pdf title. Default is null.
*
* @param pdfTitle the pdf title
*/
public void setPdfTitle(String pdfTitle) {
this.pdfTitle = pdfTitle;
}
/**
* Gets html title. Default is null. This will be ignored if the header/footer is TextHeaderFooter.
*
* @return the html title
*/
public String getHtmlTitle() {
return htmlTitle;
}
/**
* Sets html title. Default is null. This will be ignored if the header/footer is TextHeaderFooter.
*
* @param htmlTitle the html title
*/
public void setHtmlTitle(String htmlTitle) {
this.htmlTitle = htmlTitle;
}
}