KeyView 24.4
KeyView HTML Export SDK Java Programming Guide

# Obtain File Format Information

The KeyView format detection module (`kwad`) detects a file's format.

This feature enables you to apply customized conversion settings based on a file's format.

To extract file format information

1. Set the input source using the `setInputSource` method.

2. Call the `getAutoDetectInfo()` method of the `Export` object.

   This method extracts the format, file class, version, and document attributes, and returns an object of the `AutoDetectInfo` class.

3. Use the methods of the `AutoDetectInfo` object to retrieve the format information.

The `HtmlTest` sample program demonstrates how to extract format information through the Java API. See HtmlTest.

## Example

    AutoDetectInfo adinfo = objHtmlExport.getAutoDetectInfo();
    if(adinfo != null)
    {
      outf_format = new File(docFormatOutFile);
      fos_format = new FileOutputStream(outf_format);
      DataOutputStream dos_format = new DataOutputStream(fos_format);
      dos_format.writeBytes("Auto-detection result: \n");
      dos_format.writeBytes("\nCharacter set:   " + adinfo.getCharacterSet());
      dos_format.writeBytes("\nDocument class:  " + adinfo.getDocumentClass());
      dos_format.writeBytes("\nDocument format: " + adinfo.getDocumentFormat());
      dos_format.writeBytes("\nFormat version:  " + adinfo.getVersion());
      dos_format.writeBytes("\nOther attributes:");
      if(adinfo.isAppleDoubleEncoded())
      {
        dos_format.writeBytes("\nApple double encoded.");
      }
      if(adinfo.isAppleSingleEncoded())
      {
        dos_format.writeBytes("\nApple single encoded.");
      }
      if(adinfo.isEncrypted())
      {
        dos_format.writeBytes("\nEncrypted.");
      }
      if(adinfo.isMacBinaryEncoded())
      {
        dos_format.writeBytes("\nMac binary encoded.");
      }
      if(adinfo.isWangGDLencoded())
      {
        dos_format.writeBytes("\nWang GDL encoded.");
      }
      dos_format.close();
      fos_format.close();
      adinfo = null;

Copyright 1997-2024 Open Text
Version 24.4 | Last updated September 2024

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to MFI-swpdl.idoldocsfeedback@opentext.com.

We appreciate your feedback!

Product: IDOL KeyView 24.4

Topic Title: Obtain File Format Information