Glasswall Document Processing - File to File
    • PDF

    Glasswall Document Processing - File to File

    • PDF

    Article summary

    These functions process the specified document and publish the resulting output to the specified file locations. Each of the function signatures requires the client application to specify file locations to which the reports or managed documents can be written. It is the responsibility of the client application to ensure that the folder containing the specified file location exists. If the containing folder does not exist, or 'write privileges' are not enabled, the processing function will return a negative error status, eGwFileStatus.

    Functions

    GWFileToFileAnalysisAudit

    int GWFileToFileAnalysisAudit (wchar_t * inputFilePathName, wchar_t * wcType, wchar_t * analysisFilePathName)

    This function carries out an Analysis Audit on the specified file, saving the resultant report to the specified file location.

    Parameters

    in

    inputFilePathName

    input file path for Glasswall processing.

    in

    wcType

    file data type

    in,out

    analysisFilePathName

    destination for analysis (XML) file from Glasswall processing.

    Returns

    Attention

    The folders specified in the paths of the output files must already exist and have appropriate write permissions.

    Remarks

    Glasswall GWFileToFileAnalysisAudit processing example with analysis.

    // Library configuration
    wchar_t* cmPolicy = getClientApplicationConfigurationXML();
    
    if (eGwFileStatus_Success == GWFileConfigXML(cmPolicy))
    {
    createFolder("C:\\data\\audit.issues");
    
    if(eGwFileStatus_Success == 
    GWFileToFileAnalysisAudit(L"C:\\data\\temp1.pdf", L"pdf", 
    L"C:\\data\\audit.issues\\temp1_.xml"))
        {
            // process analysis report 
        }
    }

    GWFileToFileAnalysisAuditAndReport

    int GWFileToFileAnalysisAuditAndReport (wchar_t * inputFilePathName, wchar_t * wcType, wchar_t * analysisFilePathName, wchar_t * reportFilePathName)

    This function carries out an analysis audit on the specified file saving the results and a detailed report to the specified files.

    Parameters

    in

    inputFilePathName

    input file path for Glasswall processing.

    in

    wcType

    file data type

    out

    analysisFileBuffer

    analysis (XML) file buffer from Glasswall processing.

    out

    analysisFileBufferLength

    length of the analysisFileBuffer that has been allocated.

    Returns

    Attention

    The folders specified in the paths of the output files must already exist and have appropriate write permissions.

    Remarks

    Glasswall GWFileToFileAnalysisAuditAndReport processing example.

    // Library configuration
    wchar_t* cmPolicy = getClientApplicationConfigurationXML();
    
    if (eGwFileStatus_Success == GWFileConfigXML(cmPolicy))
    {
        if(eGwFileStatus_Success == 
    GWFileToFileAnalysisAuditAndReport(L"C:\\data\\temp1.pdf", L"pdf", 
    L"C:\\data\\output\\temp1_audit.xml", L"C:\\data\\output\\temp1_audit.log"))
        {
            // process analysis file
            // process report file
        }
    }

    GWFileToFileAnalysisProtectAndExport

    int GWFileToFileAnalysisProtectAndExport (const wchar_t * inputFilePathName, const wchar_t * exportFilePathName)

    This function manages the specified file, carries out an Analysis Audit, extracts any text and image content which can be isolated, and saves the results to the specified file location.

    The output will be a zip archive file with the following:

    • Glasswall XML analysis report extended to include additional information and metadata which can be used to identify a particular item of image or text data within the export package and identify its point of origin within the original document for re-insertion after further processing if required. Note: Re-insertion is currently only supported for image files.
    • The managed file.
    • The extracted image and/or text data with each item taking the form of a separate file within the zip archive.

    Parameters

    in

    inputFilePathName

    input file path for Glasswall processing.

    out

    exportFilePathNam

    destination for content export (zip) file from Glasswall processing

    Returns

    Attention

    The folders specified in the paths of the output files must already exist and have appropriate write permissions. Input file type will be automagically detected.

    Remarks

    Glasswall GWFileToFileAnalysisProtectAndExport processing example.

    // Library configuration
    eGwFileStatus status  = eGwFileStatus_Error;
    wchar_t* cmPolicy     = getClientApplicationConfigurationXML();
    
    if (eGwFileStatus_Success == GWFileConfigXML(cmPolicy))
    {
        status = GWFileToFileAnalysisProtectAndExport(L"C:\\data\\temp1.pdf", 
    L"C:\\data\\output\\temp1.zip"));
    
        if( status != eGwFileStatus_SuccessExportWriteFailure
             && status != eGwFileStatus_ErrorExportWriteFailure )
        {
            // extract content of output package.
            // process managed file if it was managed successfully
            // process analysis file
            // process exported content files
        }
        else
        {  
            // error handling
        }
    }
    else
    {
        // error handling
    }
    

    GWFileToFileProtect

    int GWFileToFileProtect (wchar_t * inputFilePathName, wchar_t * wcType, wchar_t * outputFilePathName)

    This function Manages the specified file saving the managed output to the specified file.

    Parameters

    in

    inputFilePathName

    input file path for Glasswall processing.

    in

    wcType

    file data type

    in

    outputFilePathName

    destination for output file from Glasswall processing.

    Returns

    Attention

    The folders specified in the paths of the output files must already exist and have appropriate write permissions.

    Remarks

    Glasswall GWFileToFileProtect processing example.

    // Library configuration
    wchar_t* cmPolicy = getClientApplicationConfigurationXML();
    
    if (eGwFileStatus_Success == GWFileConfigXML(cmPolicy))
    {
        createFolder("C:\\output");
    
        if(eGwFileStatus_Success == GWFileToFileProtect(L"C:\\data\\temp1.pdf", 
    L"pdf", L"C:\\output\\temp1.pdf"))
        {
            // process output file
        }
    }
    else
    {
        // error handling
    }

    GWFileToFileProtectAndImport

    int GWFileToFileProtectAndImport (const wchar_t * inputFilePathName, const wchar_t * outputFilePathName)

    This function takes a file in the form of a zip archive originally generated by GWFileToFileAnalysisProtectAndExport, extracts the managed file, the XML analysis file, and externally validated (and if necessary and/or appropriate reconstructed) image data and uses the metadata encoded in the analysis file to regenerate the managed file replacing the original image content replaced with the externally processed versions.

    Parameters

    in

    inputFilePathName

    input file path for Glasswall processing.

    in

    outputFilePathName

    destination for output file from Glasswall processing.

    Returns

    Attention

    The folders specified in the paths of the output files must already exist and have appropriate write permissions. Input file type will be automatically detected.

    Remarks

    Glasswall GWFileToFileProtectAndImport processing example.

    // Library configuration
    wchar_t* cmPolicy = getClientApplicationConfigurationXML();
    
    if (eGwFileStatus_Success == GWFileConfigXML(cmPolicy))
    {
        if(eGwFileStatus_Success == 
    GWFileToFileProtectAndImport(L"C:\\data\\output\\temp1.zip", 
    L"C:\\output\\import1.pdf" ))
        {
            // process output file
        }
        else
        {
             // error handling
        }
    }
    else
    {
        // error handling
    }

    GWFileToFileProtectAndReport

    int GWFileToFileProtectAndReport (wchar_t * inputFilePathName, wchar_t * wcType, wchar_t * outputFilePathName, wchar_t * reportFilePathName)

    This function Manages the specified file, saving the managed output and a detailed process log to the specified file locations.

    Parameters

    in

    inputFilePathName

    input file path for Glasswall processing.

    in

    wcType

    file data type

    out

    outputFilePathName

    destination for output file from Glasswall processing.

    out

    reportFilePathName

    detailed report file buffer from Glasswall processing.

    Returns

    Attention

    The folders specified in the paths of the output files must already exist and have appropriate write permissions.

    Remarks

    Glasswall GWFileToFileProtectAndReport processing example.

    // Library configuration
    wchar_t* cmPolicy = getClientApplicationConfigurationXML();
    if (eGwFileStatus_Success == GWFileConfigXML(cmPolicy))
    {
        createFolder("C:\\data\\output");
    
        if(eGwFileStatus_Success == 
    GWFileToFileProtectAndReport(L"C:\\data\\temp1.pdf", L"pdf", 
    L"C:\\data\\output\\temp1.pdf", L"C:\\data\\output\\temp1.log"))
        {
            // process managed file
            // process report file
        }
    }
    else
    {
        // error handling
    }

    GWFileToFileProtectLite

    int GWFileToFileProtectLite (wchar_t * inputFilePathName, wchar_t * wcType, wchar_t * outputFilePathName)

    This function is a restricted version of GWFileToFileProtect.

    This function Manages the specified file saving the managed output to the specified file.

    Parameters

    in

    inputFilePathName

    input file path for Glasswall processing.

    in

    wcType

    file data type

    in

    outputFilePathName

    destination for output file from Glasswall processing.

    Returns

    Attention

    The folders specified in the paths of the output files must already exist and have appropriate write permissions.

    Remarks

    Glasswall GWFileToFileProtectLite processing example.

    // managed file output buffer and length void *fileImage = NULL;
    fileImageLength = 0;
    
    // Library configuration
    wchar_t* cmPolicy = getClientApplicationConfigurationXML();
    
    if (eGwFileStatus_Success == GWFileConfigXML(cmPolicy))
    {
        createFolder("C:\\output\\");
    
        if(eGwFileStatus_Success == GWFileToFileProtectLite( "C:\\data\\temp1.pdf", 
    "pdf", "C:\\output\\temp1.pdf" )
        {
            // process output file
        }
    }
    else
    {
        // error handling
    }

    GWFileToFileProtectLiteAndReport

    int GWFileToFileProtectLiteAndReport (wchar_t * inputFilePathName, wchar_t * wcType, wchar_t * outputFilePathName, wchar_t * reportFilePathName)

    This function is a restricted version of GWFileToFileProtectAndReport

    This function Manages the specified file, saving the managed output and a detailed process log to the specified file locations.

    Parameters

    in

    inputFilePathName

    input file path for Glasswall processing.

    in

    wcType

    file data type

    out

    outputFilePathName

    destination for output file from Glasswall processing.

    out

    reportFilePathName

    detailed report file buffer from Glasswall processing.

    Returns

    Attention

    The folders specified in the paths of the output files must already exist and have appropriate write permissions.

    Remarks

    Glasswall GWFileToFileProtectLiteAndReport processing example.

    // Library configuration
    wchar_t* cmPolicy = getClientApplicationConfigurationXML();
    
    if (eGwFileStatus_Success == GWFileConfigXML(cmPolicy))
    {
        createFolder("C:\\data\\output");
    
        if(eGwFileStatus_Success == 
    GWFileToFileProtectLiteAndReport(L"C:\\data\\temp1.pdf", L"pdf", 
    L"C:\\data\\output\\temp1.pdf", L"C:\\data\\output\\temp1.log"))
        {
            // process managed file
            // process report file
        }
    }
    else
    {
        // error handling
    }

    Was this article helpful?