All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ironsoftware.ironpdf.headerfooter.TextHeaderFooter Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 2024.10.1
Show newest version
package com.ironsoftware.ironpdf.headerfooter;

import com.ironsoftware.ironpdf.font.FontTypes;

/**
 * Defines a text based PDF Header and Footer.
 * 

{@link TextHeaderFooter} uses a fast and logical approach to rendering Headers and Footers for the most * common use cases. A more advanced option available to developers is {@link HtmlHeaderFooter}.

*

See:{@link com.ironsoftware.ironpdf.PdfDocument#addTextHeader(TextHeaderFooter)} & {@link com.ironsoftware.ironpdf.PdfDocument#addTextFooter(TextHeaderFooter)}

*/ public class TextHeaderFooter implements Cloneable { /** * Sets the centered header text for the PDF document.

Merge meta-data into your header using * any of these placeholder strings: {page} {total-pages} {url} {date} {time} {html-title} * {pdf-title}

*/ private String centerText = null; /** * Adds a horizontal line divider between the header / footer and the page content on every page * of the PDF document. */ private boolean drawDividerLine = false; private String dividerLineColorCode = "#b1b1b1"; private FontTypes Font = FontTypes.getArial(); /** * Font size in px. */ private double fontSize = 10; /** * Sets the left hand side header text for the PDF document.

Merge meta-data into your header * using any of these placeholder strings: {page} {total-pages} {url} {date} {time} {html-title} * {pdf-title}

*/ private String leftText = null; /** * Sets the right hand side header text for the PDF document.

Merge meta-data into your header * using any of these placeholder strings: {page} {total-pages} {url} {date} {time} {html-title} * {pdf-title}

*/ private String rightText = null; /** * Vertical spacing between the header and page content in millimeters. */ private double spacing = 5; /** * Gets center text. The centered header text for the PDF document.

Merge meta-data into your header using * any of these placeholder strings: {page} {total-pages} {url} {date} {time} {html-title} {pdf-title}

* * @return the center text */ public String getCenterText() { return centerText; } /** * Sets center text. The centered header text for the PDF document.

Merge meta-data into your header using * any of these placeholder strings: {page} {total-pages} {url} {date} {time} {html-title} {pdf-title}

* * @param value the value */ public void setCenterText(String value) { centerText = value; } /** * Is draw divider line boolean. A horizontal line divider between the header / footer and the page content on every page * of the PDF document. * * @return the boolean */ public boolean isDrawDividerLine() { return drawDividerLine; } /** * Sets draw divider line. A horizontal line divider between the header / footer and the page content on every page * of the PDF document. * * @param value the value */ public void setDrawDividerLine(boolean value) { drawDividerLine = value; } /** * Gets divider line color code. * * @return the color code */ public String getDividerLineColor() { return dividerLineColorCode; } /** * Sets divider line color. * * @param colorCode color code */ public void setDividerLineColor(String colorCode) { dividerLineColorCode = colorCode; } /** * Gets font. * * @return the font */ public FontTypes getFont() { return Font; } /** * Sets font. * * @param value the value */ public void setFont(FontTypes value) { Font = value; } /** * Gets font size. * * @return the font size */ public double getFontSize() { return fontSize; } /** * Sets font size. * * @param value the value */ public void setFontSize(double value) { fontSize = value; } /** * Gets left text. The left hand side header text for the PDF document.

Merge meta-data into your header * using any of these placeholder strings: {page} {total-pages} {url} {date} {time} {html-title} {pdf-title}

* * @return the left text */ public String getLeftText() { return leftText; } /** * Sets left text. The left hand side header text for the PDF document.

Merge meta-data into your header * using any of these placeholder strings: {page} {total-pages} {url} {date} {time} {html-title} {pdf-title}

* * @param value the value */ public void setLeftText(String value) { leftText = value; } /** * Gets right text. The right hand side header text for the PDF document.

Merge meta-data into your header * using any of these placeholder strings: {page} {total-pages} {url} {date} {time} {html-title} * {pdf-title}

* * @return the right text */ public String getRightText() { return rightText; } /** * Sets right text. The right hand side header text for the PDF document.

Merge meta-data into your header * using any of these placeholder strings: {page} {total-pages} {url} {date} {time} {html-title} * {pdf-title}

* * @param value the value */ public void setRightText(String value) { rightText = value; } /** * Gets spacing. * * @return the spacing */ public double getSpacing() { return spacing; } /** * Sets spacing. * * @param value the value */ public void setSpacing(double value) { spacing = value; } /** * Clones this instance. * * @return System.Object of type SimpleHeaderFooter * @throws CloneNotSupportedException the clone not supported exception */ public Object Clone() throws CloneNotSupportedException { return this.clone(); } /** * Creates a text based PDF Header and Footer. * Please set any of {@link #setLeftText(String)}, {@link #setCenterText(String)} or {@link #setRightText(String)} */ public TextHeaderFooter() { } /** * Creates a text based PDF Header and Footer. * * @param leftText the left text. Default is null. * @param centerText the center text. Default is null. * @param rightText the right text. Default is null. */ public TextHeaderFooter(String leftText, String centerText, String rightText) { this.leftText = leftText; this.centerText = centerText; this.rightText = rightText; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy