Package org.silverpeas.core.util
Class PdfUtil
- java.lang.Object
-
- org.silverpeas.core.util.PdfUtil
-
public class PdfUtil extends Object
User: Yohann Chastagnier Date: 08/07/13
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidfirstPageAsImage(File pdfSource, File imageDestination)Converts the first page of a PDF file into a JPEG image.static DocumentInfogetDocumentInfo(File pdfSource)Gets some document info from a PDF file.static voidstamp(File pdfSource, File stampImage, File pdfDestination)Add a image stamp on each page of a PDF file.static voidstamp(InputStream pdfSource, File stampImage, OutputStream pdfDestination)Add a image stamp on each page of a PDF file.static voidwatermark(File pdfSource, File watermarkImage, File pdfDestination)Add a image watermark on each page of a PDF file.static voidwatermark(InputStream pdfSource, File watermarkImage, OutputStream pdfDestination)Add a image watermark on each page of a PDF file.
-
-
-
Method Detail
-
getDocumentInfo
public static DocumentInfo getDocumentInfo(File pdfSource)
Gets some document info from a PDF file.- Parameters:
pdfSource- the source pdf file, this content is not modified by this method- Returns:
- a
DocumentInfoinstance.
-
firstPageAsImage
public static void firstPageAsImage(File pdfSource, File imageDestination)
Converts the first page of a PDF file into a JPEG image.- Parameters:
pdfSource- the source pdf file, this content is not modified by this method.imageDestination- the destination file of the image representing the first page.
-
stamp
public static void stamp(File pdfSource, File stampImage, File pdfDestination)
Add a image stamp on each page of a PDF file.- Parameters:
pdfSource- the source pdf file, this content is not modified by this methodstampImage- the stamp image filepdfDestination- the destination pdf file, with the stamp in its foreground
-
stamp
public static void stamp(InputStream pdfSource, File stampImage, OutputStream pdfDestination)
Add a image stamp on each page of a PDF file.- Parameters:
pdfSource- the source pdf file, this content is not modified by this methodstampImage- the stamp image filepdfDestination- the destination pdf file, with the stamp in its foreground
-
watermark
public static void watermark(File pdfSource, File watermarkImage, File pdfDestination)
Add a image watermark on each page of a PDF file.- Parameters:
pdfSource- the source pdf file, this content is not modified by this methodwatermarkImage- the watermark image filepdfDestination- the destination pdf file, with the watermark in its background
-
watermark
public static void watermark(InputStream pdfSource, File watermarkImage, OutputStream pdfDestination)
Add a image watermark on each page of a PDF file.- Parameters:
pdfSource- the source pdf file, this content is not modified by this methodwatermarkImage- the watermark image filepdfDestination- the destination pdf file, with the watermark in its background
-
-