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 void
firstPageAsImage(File pdfSource, File imageDestination)
Converts the first page of a PDF file into a JPEG image.static DocumentInfo
getDocumentInfo(File pdfSource)
Gets some document info from a PDF file.static void
stamp(File pdfSource, File stampImage, File pdfDestination)
Add a image stamp on each page of a PDF file.static void
stamp(InputStream pdfSource, File stampImage, OutputStream pdfDestination)
Add a image stamp on each page of a PDF file.static void
watermark(File pdfSource, File watermarkImage, File pdfDestination)
Add a image watermark on each page of a PDF file.static void
watermark(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
DocumentInfo
instance.
-
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
-
-