Package org.docx4j.services.client
Class ConverterHttp
java.lang.Object
org.docx4j.services.client.ConverterHttp
- All Implemented Interfaces:
Converter
Java client library for Plutext PDF Converter
- Since:
- 3.3.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconvert(byte[] bytesIn, OutputStream os) Convert docx byte array to PDF, streaming result to OutputStream os.voidconvert(byte[] bytesIn, Format fromFormat, Format toFormat, OutputStream os) Convert byte array fromFormat to toFormat, streaming result to OutputStream os.voidconvert(File f, Format fromFormat, Format toFormat, OutputStream os) Convert File fromFormat to toFormat, streaming result to OutputStream os.voidconvert(InputStream instream, Format fromFormat, Format toFormat, 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, OutputStream os)
-
Constructor Details
-
ConverterHttp
public ConverterHttp() -
ConverterHttp
-
-
Method Details
-
convert
public void convert(File f, Format fromFormat, Format toFormat, OutputStream os) throws IOException, ConversionException Convert 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:
IOExceptionConversionException
-
convert
public void convert(InputStream instream, Format fromFormat, Format toFormat, OutputStream os) throws 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:
convertin interfaceConverter- Parameters:
instream-fromFormat-toFormat-os-- Throws:
IOExceptionConversionException
-
convert
Convert docx byte array to PDF, streaming result to OutputStream os.- Parameters:
bytesIn-os-- Throws:
IOExceptionConversionException- Since:
- 8.3.1
-
convert
public void convert(byte[] bytesIn, Format fromFormat, Format toFormat, OutputStream os) throws IOException, ConversionException Convert 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:
IOExceptionConversionException
-
execute
protected void execute(org.apache.http.impl.client.CloseableHttpClient httpclient, org.apache.http.client.methods.HttpPost httppost, OutputStream os) throws org.apache.http.client.ClientProtocolException, ConversionException - Parameters:
httpclient-httppost-os-- Throws:
IOExceptionorg.apache.http.client.ClientProtocolExceptionConversionException
-