wsclient library: webservice converter
Minimum requirements
- Java version: 7
- webPDF version: 7
- wsclient version: 1
This example shows how to use the Converter operation via the webPDF wsclient library.
Getting started with REST or SOAP session
Use WebServiceFactory to create a service object depending on your protocol:
ConverterWebService converterWebService = WebServiceFactory.createInstance(session, WebServiceType.CONVERTER);
or
ConverterRestWebService converterWebService = WebServiceFactory.createInstance(session, WebServiceType.CONVERTER);
Then set a SoapDocument or RestDocument via setDocument().
Converter webservice
The Converter endpoint converts numerous input formats to PDF.
ConverterType converterType = converterWebService.getOperation();
Important parameters (excerpt)
pages
Page selection, e.g. *, 1, 1-5, 1,3-5.
accessPassword
Password for protected source documents.
compression
Compress data objects in the output PDF.
dpi
Output resolution (for example 300 DPI).
embedFonts
Embed fonts in the target document.
jpegQuality
Control JPEG output quality.
fileExtension
Manually set file format detection for special cases.
Objects in Converter
html
Options for HTML-based sources (for example adjustFonts, baseURL, downloadImages).
mail
Options for email conversion (for example attachmentMode, downloadImages).
officeBridge
Uses Office Bridge for Office conversion.
sharePointBridge
Uses SharePoint service for Word conversion.
page
Page parameters such as margins, height, width, and unit.
pdfa
Direct PDF/A conversion via PdfaType.
signature
Signature settings via SignatureType.
report
Extended error reporting for text-based documents.
template
Template settings for template-based conversion.
SOAP example call
try (
SoapSession session = SessionFactory.createInstance(
WebServiceProtocol.SOAP,
new URL("https://localhost:8080/webPDF/")
);
SoapDocument soapDocument = new SoapDocument(
new File("Path to source document").toURI(),
new File("Path to target document")
)
) {
// Webservice call
} catch (ResultException | MalformedURLException ex) {
// Error handling
}
Further information: