Class PdfUtil


  • public class PdfUtil
    extends Object
    User: Yohann Chastagnier Date: 08/07/13
    • 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 method
        stampImage - the stamp image file
        pdfDestination - 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 method
        stampImage - the stamp image file
        pdfDestination - 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 method
        watermarkImage - the watermark image file
        pdfDestination - 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 method
        watermarkImage - the watermark image file
        pdfDestination - the destination pdf file, with the watermark in its background