ISDOC.PDF
ISDOC.PDF is a format for the electronic representation of both the visual and content aspects of an invoice. It is a PDF file that includes an XML representation of the invoice in the ISDOC format.
This repository provides supporting information and examples for implementing ISDOC.PDF support in your applications.
The ISDOC.PDF format is defined as part of ISDOC – the national standard for electronic invoicing.
ISDOC.PDF Processing in TAS
In TAS, we have the following calculations for processing ISDOC.PDF files:
Each calculation can work either with an attachment in a case or by referencing a specific path in the Document Management System (DMS):
1. Checking if a File is in ISDOC.PDF Format
Function: lib.isIsdocPdfFile()
This function works with a document-type variable. Note that the document variable is used without .getValue()
.
Example Usage:
lib.isIsdocPdfFile(vars['attachment']);
Returns: An array of boolean values, e.g., [true, false, false]
(if three attachments are selected and only the first is in ISDOC.PDF format).
Common Use Case in Templates:
Typically, you process all attachments in a case, such as those attached via email extraction using Microsoft Graph.
let docs = lib.getDMSFileNames('*', null); // Get all attachments from the case
vars['attachment'].setValue(docs); // Set the document-type variable to the selected attachments
const isItIsdoc = lib.isIsdocPdfFile(vars['attachment']);
// isItIsdoc = [true, false, false]
2. Extracting Data from ISDOC.PDF
Function: lib.parseIsdocPdfFileContent()
This function retrieves metadata from an attached ISDOC.PDF file.
Example Usage:
lib.parseIsdocPdfFileContent(vars['attachment']);
Returns: An array of objects, e.g., [{pdf_content}, null, null]
Common Use Case:
let docs = lib.getDMSFileNames('*', null); // Get all attachments from the case
vars['attachment'].setValue(docs); // Set the document-type variable to the selected attachments
const isDocsContent = lib.parseIsdocPdfFileContent(vars['attachment']);
// isDocsContent = [{pdf_content}, null, null]
Alternative Approach: Working with a Direct File Path
Instead of using attachments in a case, you can work directly with a specific file path.
Checking if a File is ISDOC.PDF:
lib.isIsdocPdfFileByPath(filepath: string);
Returns: Boolean
Extracting Data from ISDOC.PDF:
lib.parseIsdocPdfFileContentByPath(filepath: string);
Returns: The document content
This approach is useful when working with external document sources outside of the TAS case attachments.
Updated
by Anna Gernát