Class PdfConverter
- java.lang.Object
-
- org.plutext.msgraph.convert.AbstractOpenXmlToPDF
-
- org.plutext.msgraph.convert.scribe.PdfConverter
-
- All Implemented Interfaces:
OpenXmlToPDF
- Direct Known Subclasses:
DocxToPdfConverter,PptxToPdfConverter,XlsxToPdfConverter
public abstract class PdfConverter extends AbstractOpenXmlToPDF
To use scribejava, we need 3 tweaks; see https://github.com/scribejava/scribejava/pull/979 Until that PR is implemented, we workaround locally.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) FileServicefsprivate static org.slf4j.Loggerlog-
Fields inherited from class org.plutext.msgraph.convert.AbstractOpenXmlToPDF
authConfig, DOCX_MEDIA_TYPE, DOCX_MIME_TYPE, PPTX_MEDIA_TYPE, PPTX_MIME_TYPE, XLSX_MEDIA_TYPE, XLSX_MIME_TYPE
-
-
Constructor Summary
Constructors Constructor Description PdfConverter(AuthConfig authConfig)PdfConverter using scribe's JDKHttpClientPdfConverter(AuthConfig authConfig, com.github.scribejava.core.httpclient.HttpClient httpClient)PdfConverter using specified HttpClient, configured in your pom.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]convert(java.io.InputStream docx, java.lang.String ext)byte[]convertMime(byte[] docx, java.lang.String mimetype)byte[]convertMime(java.io.File inFile, java.lang.String mimetype)Note that JDKHttpClient does not support File payloadprivate com.github.scribejava.core.oauth.OAuth20ServicegetAuthService(com.github.scribejava.apis.MicrosoftAzureActiveDirectory20Api api, AuthConfig authConfig)-
Methods inherited from class org.plutext.msgraph.convert.AbstractOpenXmlToPDF
mimeTypeToExt
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.plutext.msgraph.convert.OpenXmlToPDF
convert
-
-
-
-
Field Detail
-
log
private static final org.slf4j.Logger log
-
fs
FileService fs
-
-
Constructor Detail
-
PdfConverter
public PdfConverter(AuthConfig authConfig) throws ConversionException
PdfConverter using scribe's JDKHttpClient- Parameters:
authConfig-- Throws:
ConversionException
-
PdfConverter
public PdfConverter(AuthConfig authConfig, com.github.scribejava.core.httpclient.HttpClient httpClient) throws ConversionException
PdfConverter using specified HttpClient, configured in your pom.- Parameters:
authConfig-- Throws:
ConversionException
-
-
Method Detail
-
convertMime
public byte[] convertMime(byte[] docx, java.lang.String mimetype) throws ConversionException- Throws:
ConversionException
-
convertMime
public byte[] convertMime(java.io.File inFile, java.lang.String mimetype) throws ConversionException, java.io.IOExceptionNote that JDKHttpClient does not support File payload- Throws:
ConversionExceptionjava.io.IOException
-
convert
public byte[] convert(java.io.InputStream docx, java.lang.String ext) throws ConversionException, java.io.IOException- Throws:
ConversionExceptionjava.io.IOException
-
getAuthService
private com.github.scribejava.core.oauth.OAuth20Service getAuthService(com.github.scribejava.apis.MicrosoftAzureActiveDirectory20Api api, AuthConfig authConfig) throws ConversionException- Throws:
ConversionException
-
-