Search in sources :

Example 1 with DocumentSort

use of org.incode.module.document.dom.impl.docs.DocumentSort in project estatio by estatio.

the class DocAndCommAbstract_downloadSelected method appendBytes.

private static void appendBytes(final Document document, final List<byte[]> pdfBytes) {
    if (document.getState() != DocumentState.RENDERED || !DocumentPredicates.isPdfAndBlob().apply(document)) {
        return;
    }
    final DocumentSort documentSort = document.getSort();
    final byte[] bytes = documentSort.asBytes(document);
    pdfBytes.add(bytes);
}
Also used : DocumentSort(org.incode.module.document.dom.impl.docs.DocumentSort)

Example 2 with DocumentSort

use of org.incode.module.document.dom.impl.docs.DocumentSort in project estatio by estatio.

the class DocAndCommAbstract_download method appendBytes.

private static void appendBytes(final Document document, final List<byte[]> pdfBytes) {
    if (document.getState() != DocumentState.RENDERED || !DocumentPredicates.isPdfAndBlob().apply(document)) {
        return;
    }
    final DocumentSort documentSort = document.getSort();
    final byte[] bytes = documentSort.asBytes(document);
    pdfBytes.add(bytes);
}
Also used : DocumentSort(org.incode.module.document.dom.impl.docs.DocumentSort)

Example 3 with DocumentSort

use of org.incode.module.document.dom.impl.docs.DocumentSort in project estatio by estatio.

the class InvoiceForLease_sendAbstract method appendBytesIfPdf.

private static void appendBytesIfPdf(final Document docAttachedToDocument, final List<byte[]> pdfBytes) {
    final DocumentSort attachedDocSort = docAttachedToDocument.getSort();
    if (!attachedDocSort.isBytes()) {
        return;
    }
    final String mimeType = docAttachedToDocument.getMimeType();
    if (!DocumentConstants.MIME_TYPE_APPLICATION_PDF.equals(mimeType)) {
        return;
    }
    final byte[] attachedDocBytes = attachedDocSort.asBytes(docAttachedToDocument);
    pdfBytes.add(attachedDocBytes);
}
Also used : DocumentSort(org.incode.module.document.dom.impl.docs.DocumentSort)

Aggregations

DocumentSort (org.incode.module.document.dom.impl.docs.DocumentSort)3