Package org.docx4j.services.client
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 voidconvert(byte[] bytesIn, java.io.OutputStream os)Convert docx byte array to PDF, streaming result to OutputStream os.voidconvert(byte[] bytesIn, Format fromFormat, Format toFormat, java.io.OutputStream os)Convert byte array fromFormat to toFormat, streaming result to OutputStream os.voidconvert(java.io.File f, Format fromFormat, Format toFormat, java.io.OutputStream os)Convert File fromFormat to toFormat, streaming result to OutputStream os.voidconvert(java.io.InputStream instream, Format fromFormat, Format toFormat, java.io.OutputStream os)Convert InputStream fromFormat to toFormat, streaming result to OutputStream os.protected voidexecute(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, ConversionExceptionConvert File fromFormat to toFormat, streaming result to OutputStream os. fromFormat supported: DOC, DOCX toFormat supported: PDF- Specified by:
convertin interfaceConverter- Parameters:
f-fromFormat-toFormat-os-- Throws:
java.io.IOExceptionConversionException
-
convert
public void convert(java.io.InputStream instream, Format fromFormat, Format toFormat, java.io.OutputStream os) throws java.io.IOException, ConversionExceptionConvert 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:
convertin interfaceConverter- Parameters:
instream-fromFormat-toFormat-os-- Throws:
java.io.IOExceptionConversionException
-
convert
public void convert(byte[] bytesIn, java.io.OutputStream os) throws java.io.IOException, ConversionExceptionConvert docx byte array to PDF, streaming result to OutputStream os.- Parameters:
bytesIn-os-- Throws:
java.io.IOExceptionConversionException- Since:
- 8.3.1
-
convert
public void convert(byte[] bytesIn, Format fromFormat, Format toFormat, java.io.OutputStream os) throws java.io.IOException, ConversionExceptionConvert byte array fromFormat to toFormat, streaming result to OutputStream os. fromFormat supported: DOC, DOCX toFormat supported: PDF- Specified by:
convertin interfaceConverter- Parameters:
bytesIn-fromFormat-toFormat-os-- Throws:
java.io.IOExceptionConversionException
-
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.IOExceptionorg.apache.http.client.ClientProtocolExceptionConversionException
-