Class ConverterHttp

java.lang.Object
org.docx4j.services.client.ConverterHttp
All Implemented Interfaces:
Converter

public class ConverterHttp
extends java.lang.Object
implements Converter
Java client library for Plutext PDF Converter
Since:
3.3.0
  • Constructor Summary

    Constructors
    Constructor Description
    ConverterHttp()  
    ConverterHttp​(java.lang.String endpointURL)  
  • Method Summary

    Modifier and Type Method Description
    void convert​(byte[] bytesIn, java.io.OutputStream os)
    Convert docx byte array to PDF, streaming result to OutputStream os.
    void convert​(byte[] bytesIn, Format fromFormat, Format toFormat, java.io.OutputStream os)
    Convert byte array fromFormat to toFormat, streaming result to OutputStream os.
    void convert​(java.io.File f, Format fromFormat, Format toFormat, java.io.OutputStream os)
    Convert File fromFormat to toFormat, streaming result to OutputStream os.
    void convert​(java.io.InputStream instream, Format fromFormat, Format toFormat, java.io.OutputStream os)
    Convert InputStream fromFormat to toFormat, streaming result to OutputStream os.
    protected void execute​(org.apache.http.impl.client.CloseableHttpClient httpclient, org.apache.http.client.methods.HttpPost httppost, java.io.OutputStream os)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ConverterHttp

      public ConverterHttp()
    • ConverterHttp

      public ConverterHttp​(java.lang.String endpointURL)
  • Method Details

    • convert

      public void convert​(java.io.File f, Format fromFormat, Format toFormat, java.io.OutputStream os) throws java.io.IOException, ConversionException
      Convert File fromFormat to toFormat, streaming result to OutputStream os. fromFormat supported: DOC, DOCX toFormat supported: PDF
      Specified by:
      convert in interface Converter
      Parameters:
      f -
      fromFormat -
      toFormat -
      os -
      Throws:
      java.io.IOException
      ConversionException
    • convert

      public void convert​(java.io.InputStream instream, Format fromFormat, Format toFormat, java.io.OutputStream os) throws java.io.IOException, ConversionException
      Convert InputStream fromFormat to toFormat, streaming result to OutputStream os. fromFormat supported: DOC, DOCX toFormat supported: PDF Note this uses a non-repeatable request entity, so it may not be suitable (depending on the endpoint config).
      Specified by:
      convert in interface Converter
      Parameters:
      instream -
      fromFormat -
      toFormat -
      os -
      Throws:
      java.io.IOException
      ConversionException
    • convert

      public void convert​(byte[] bytesIn, java.io.OutputStream os) throws java.io.IOException, ConversionException
      Convert docx byte array to PDF, streaming result to OutputStream os.
      Parameters:
      bytesIn -
      os -
      Throws:
      java.io.IOException
      ConversionException
      Since:
      8.3.1
    • convert

      public void convert​(byte[] bytesIn, Format fromFormat, Format toFormat, java.io.OutputStream os) throws java.io.IOException, ConversionException
      Convert byte array fromFormat to toFormat, streaming result to OutputStream os. fromFormat supported: DOC, DOCX toFormat supported: PDF
      Specified by:
      convert in interface Converter
      Parameters:
      bytesIn -
      fromFormat -
      toFormat -
      os -
      Throws:
      java.io.IOException
      ConversionException
    • execute

      protected void execute​(org.apache.http.impl.client.CloseableHttpClient httpclient, org.apache.http.client.methods.HttpPost httppost, java.io.OutputStream os) throws org.apache.http.client.ClientProtocolException, ConversionException
      Parameters:
      httpclient -
      httppost -
      os -
      Throws:
      java.io.IOException
      org.apache.http.client.ClientProtocolException
      ConversionException