Package org.nuxeo.ecm.platform.pdf
Class PDFPageNumbering
- java.lang.Object
-
- org.nuxeo.ecm.platform.pdf.PDFPageNumbering
-
public class PDFPageNumbering extends Object
Add page numbers to a PDF, with misc parameters (font, size, color, position).- Since:
- 8.10
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPDFPageNumbering.PAGE_NUMBER_POSITION
-
Field Summary
Fields Modifier and Type Field Description static floatDEFAULT_FONT_SIZE
-
Constructor Summary
Constructors Constructor Description PDFPageNumbering(Blob inBlob)PDFPageNumbering(DocumentModel inDoc, String inXPath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BlobaddPageNumbers(int inStartAtPage, int inStartAtNumber, String inFontName, float inFontSize, String inHex255Color, PDFPageNumbering.PAGE_NUMBER_POSITION inPosition)Adds page numbers and returns a new Blob.voidsetPassword(String password)
-
-
-
Field Detail
-
DEFAULT_FONT_SIZE
public static final float DEFAULT_FONT_SIZE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PDFPageNumbering
public PDFPageNumbering(Blob inBlob)
-
PDFPageNumbering
public PDFPageNumbering(DocumentModel inDoc, String inXPath)
-
-
Method Detail
-
addPageNumbers
public Blob addPageNumbers(int inStartAtPage, int inStartAtNumber, String inFontName, float inFontSize, String inHex255Color, PDFPageNumbering.PAGE_NUMBER_POSITION inPosition) throws NuxeoException
Adds page numbers and returns a new Blob. Original blob is not modified. This code assumes:- There is no page numbers already (it will always draw the numbers).
- The PDF is not rotated.
- Default values apply:
inStartAtPageandinStartAtNumberare set to 1 if they are passed as < 1.inStartAtPageis set to 1 if it is > number of pages.inFontNameis set to "Helvetica" if "" or null.inFontSizeis set to 16 if it is <= 0.inHex255Coloris set to black if "", null or if its length is < 6. Expected format is0xrrggbb,#rrggbbor justrrggbb.inPositionis set toBOTTOM_RIGHTif null.
- Parameters:
inStartAtPage- Number of the first page to be numbered.inStartAtNumber- Starting number for the page numbering.inFontName- Name of the font to be used in the numbering.inFontSize- Size of the font to be used in the numbering.inHex255Color- Color of the font to be used in the numbering.inPosition- Page positioning of the numbering.- Returns:
- Blob
- Throws:
NuxeoException
-
setPassword
public void setPassword(String password)
-
-