Class OfficeConverter

java.lang.Object
com.itextpdf.pdfoffice.OfficeConverter

public final class OfficeConverter extends Object
The main class for converting office files to PDF.
  • Method Details

    • convertOfficeDocumentToPdf

      public static void convertOfficeDocumentToPdf (File docFile, File pdfFile) throws IOException, PdfOfficeException
      Converts an office document to a PDF.
      Parameters:
      docFile - input document file
      pdfFile - output PDF file
      Throws:
      IOException - signals that an I/O exception of some sort has occurred
      PdfOfficeException - runtime exception that gets thrown if something goes wrong in the office files to PDF conversion
    • convertOfficeDocumentToPdf

      public static void convertOfficeDocumentToPdf (InputStream docInputStream, OutputStream pdfOutputStream) throws IOException, PdfOfficeException
      Converts an office document to a PDF.
      Parameters:
      docInputStream - input document stream. Note, that this method doesn't close the stream.
      pdfOutputStream - output PDF stream. Note, that this method doesn't close the stream.
      Throws:
      IOException - signals that an I/O exception of some sort has occurred
      PdfOfficeException - runtime exception that gets thrown if something goes wrong in the office files to PDF conversion
    • convertOfficeDocumentToPdf

      public static void convertOfficeDocumentToPdf (File docFile, File pdfFile, OfficeDocumentConverterProperties properties) throws IOException, PdfOfficeException
      Converts an office document to a PDF with the specified conversion properties.
      Parameters:
      docFile - input document file
      pdfFile - output PDF file
      properties - properties to configure the conversion operation
      Throws:
      IOException - signals that an I/O exception of some sort has occurred
      PdfOfficeException - runtime exception that gets thrown if something goes wrong in the office files to PDF conversion
    • convertOfficeDocumentToPdf

      public static void convertOfficeDocumentToPdf (InputStream docInputStream, OutputStream pdfOutputStream, OfficeDocumentConverterProperties properties) throws IOException, PdfOfficeException
      Converts an office document to a PDF with the specified conversion properties.
      Parameters:
      docInputStream - input document stream. Note, that this method doesn't close the stream.
      pdfOutputStream - output PDF stream. Note, that this method doesn't close the stream.
      properties - properties to configure the conversion operation
      Throws:
      IOException - signals that an I/O exception of some sort has occurred
      PdfOfficeException - runtime exception that gets thrown if something goes wrong in the office files to PDF conversion
    • convertOfficePresentationToPdf

      public static void convertOfficePresentationToPdf (File presentationFile, File pdfFile) throws IOException
      Converts an office presentation to a PDF.
      Parameters:
      presentationFile - input presentation file
      pdfFile - output PDF file
      Throws:
      IOException - signals that an I/O exception of some sort has occurred
      PdfOfficeException - runtime exception that gets thrown if something goes wrong in the office files to PDF conversion
    • convertOfficePresentationToPdf

      public static void convertOfficePresentationToPdf (InputStream presentationInputStream, OutputStream pdfOutputStream) throws IOException, PdfOfficeException
      Converts an office presentation to a PDF.
      Parameters:
      presentationInputStream - input presentation stream. Note, that this method doesn't close the stream.
      pdfOutputStream - output PDF stream. Note, that this method doesn't close the stream.
      Throws:
      IOException - signals that an I/O exception of some sort has occurred
      PdfOfficeException - runtime exception that gets thrown if something goes wrong in the office files to PDF conversion
    • convertOfficePresentationToPdf

      public static void convertOfficePresentationToPdf (File presentationFile, File pdfFile, OfficePresentationConverterProperties properties) throws IOException
      Converts an office presentation to a PDF with the specified conversion properties.
      Parameters:
      presentationFile - input presentation file
      pdfFile - output PDF file
      properties - properties to configure the conversion operation
      Throws:
      IOException - signals that an I/O exception of some sort has occurred
      PdfOfficeException - runtime exception that gets thrown if something goes wrong in the office files to PDF conversion
    • convertOfficePresentationToPdf

      public static void convertOfficePresentationToPdf (InputStream presentationInputStream, OutputStream pdfOutputStream, OfficePresentationConverterProperties properties) throws IOException, PdfOfficeException
      Converts an office presentation to a PDF with the specified conversion properties.
      Parameters:
      presentationInputStream - input presentation stream. Note, that this method doesn't close the stream.
      pdfOutputStream - output PDF stream. Note, that this method doesn't close the stream.
      properties - properties to configure the conversion operation
      Throws:
      IOException - signals that an I/O exception of some sort has occurred
      PdfOfficeException - runtime exception that gets thrown if something goes wrong in the office files to PDF conversion
    • convertOfficeSpreadsheetToPdf

      public static void convertOfficeSpreadsheetToPdf (File spreadsheetFile, File pdfFile) throws IOException
      Converts an office spreadsheet to a PDF.
      Parameters:
      spreadsheetFile - input spreadsheet file
      pdfFile - output PDF file
      Throws:
      IOException - signals that an I/O exception of some sort has occurred
      PdfOfficeException - runtime exception that gets thrown if something goes wrong in the office files to PDF conversion
    • convertOfficeSpreadsheetToPdf

      public static void convertOfficeSpreadsheetToPdf (InputStream spreadsheetInputStream, OutputStream pdfOutputStream) throws IOException, PdfOfficeException
      Converts an office spreadsheet to a PDF.
      Parameters:
      spreadsheetInputStream - input spreadsheet stream. Note, that this method doesn't close the stream.
      pdfOutputStream - output PDF stream. Note, that this method doesn't close the stream.
      Throws:
      IOException - signals that an I/O exception of some sort has occurred
      PdfOfficeException - runtime exception that gets thrown if something goes wrong in the office files to PDF conversion
    • convertOfficeSpreadsheetToPdf

      public static void convertOfficeSpreadsheetToPdf (File spreadsheetFile, File pdfFile, OfficeSpreadsheetConverterProperties properties) throws IOException
      Converts an office spreadsheet to a PDF with the specified conversion properties.
      Parameters:
      spreadsheetFile - input spreadsheet file
      pdfFile - output PDF file
      properties - properties to configure the conversion operation
      Throws:
      IOException - signals that an I/O exception of some sort has occurred
      PdfOfficeException - runtime exception that gets thrown if something goes wrong in the office files to PDF conversion
    • convertOfficeSpreadsheetToPdf

      public static void convertOfficeSpreadsheetToPdf (InputStream spreadsheetInputStream, OutputStream pdfOutputStream, OfficeSpreadsheetConverterProperties properties) throws IOException, PdfOfficeException
      Converts an office spreadsheet to a PDF with the specified conversion properties.
      Parameters:
      spreadsheetInputStream - input spreadsheet stream. Note, that this method doesn't close the stream.
      pdfOutputStream - output PDF stream. Note, that this method doesn't close the stream.
      properties - properties to configure the conversion operation
      Throws:
      IOException - signals that an I/O exception of some sort has occurred
      PdfOfficeException - runtime exception that gets thrown if something goes wrong in the office files to PDF conversion