com.pdflib

## Interface IpCOS

- All Known Implementing Classes:
    TET

      public interface IpCOS

  Interface for pCOS functions. This interface is defined for purpose of the pCOS Cookbook only and should not be used directly by client code.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `convert_to_unicode(java.lang.String inputformat, byte[] inputstring, java.lang.String optlist)` Convert a string in an arbitrary encoding to a Unicode string in various formats.
    `void` | `create_pvf(java.lang.String filename, byte[] data, java.lang.String optlist)` Create a named virtual read-only file from data provided in memory.
    `int` | `delete_pvf(java.lang.String filename)` Delete a named virtual file and free its data structures (but not the contents).
    `void` | `delete()` Delete underlying object.
    `java.lang.String` | `get_apiname()` Get the name of the API function which threw the last exception or failed.
    `java.lang.String` | `get_errmsg()` Get the text of the last thrown exception or the reason of a failed function call.
    `int` | `get_errnum()` Get the number of the last thrown exception or the reason of a failed function call.
    `double` | `info_pvf(java.lang.String filename, java.lang.String keyword)` Query properties of a virtual file or the PDFlib Virtual Filesystem (PVF).
    `void` | `pcos_close_document(int doc, java.lang.String optlist)` Close the input PDF document.
    `double` | `pcos_get_number(int doc, java.lang.String path)` Get the value of a pCOS path with type number or boolean.
    `byte[]` | `pcos_get_stream(int doc, java.lang.String optlist, java.lang.String path)` Get the contents of a pCOS path with type stream, fstream, or string.
    `java.lang.String` | `pcos_get_string(int doc, java.lang.String path)` Get the value of a pCOS path with type name, number, string, or boolean.
    `int` | `pcos_open_document(java.lang.String filename, java.lang.String optlist)` Open a disk-based or virtual PDF document and prepare it for later use.
    `void` | `set_option(java.lang.String optlist)` Set one or more global options.

- - ### Method Detail

    - #### pcos_get_number

          double pcos_get_number(int doc,
                                 java.lang.String path)
                          throws java.lang.Exception

      Get the value of a pCOS path with type number or boolean.
      Parameters:
        `doc` - A valid document handle obtained with pcos_open_document()
        `path` - A full pCOS path for a numerical or boolean object
      Returns:
        The numerical value of the object identified by the pCOS path.
      Throws:
        `java.lang.Exception` - (see manual)

    - #### pcos_get_string

          java.lang.String pcos_get_string(int doc,
                                           java.lang.String path)
                                    throws java.lang.Exception

      Get the value of a pCOS path with type name, number, string, or boolean.
      Parameters:
        `doc` - A valid document handle obtained with pcos_open_document()
        `path` - A full pCOS path for a string, number, name, or boolean object
      Returns:
        A string with the value of the object identified by the pCOS path.
      Throws:
        `java.lang.Exception` - (see manual)

    - #### pcos_get_stream

          byte[] pcos_get_stream(int doc,
                                 java.lang.String optlist,
                                 java.lang.String path)
                          throws java.lang.Exception

      Get the contents of a pCOS path with type stream, fstream, or string.
      Parameters:
        `doc` - A valid document handle obtained with pcos_open_document()
        `optlist` - An option list specifying stream retrieval options
        `path` - A full pCOS path for a stream or string object
      Returns:
        The unencrypted data contained in the stream or string.
      Throws:
        `java.lang.Exception` - (see manual)

    - #### pcos_open_document

          int pcos_open_document(java.lang.String filename,
                                 java.lang.String optlist)
                          throws java.lang.Exception

      Open a disk-based or virtual PDF document and prepare it for later use.
      Parameters:
        `filename` - The full path name of the PDF file to be opened. The file will be searched by means of the SearchPath resource.
        `optlist` - An option list with document options.
      Returns:
        A document handle.
      Throws:
        `java.lang.Exception` - (see manual)

    - #### pcos_close_document

          void pcos_close_document(int doc,
                                   java.lang.String optlist)
                            throws java.lang.Exception

      Close the input PDF document.
      Parameters:
        `doc` - A valid document handle obtained with pcos_open_document()
        `optlist` - An option list
      Throws:
        `java.lang.Exception` - (see manual)

    - #### set_option

          void set_option(java.lang.String optlist)
                   throws java.lang.Exception

      Set one or more global options.
      Parameters:
        `optlist` - An option list specifying global options
      Throws:
        `java.lang.Exception` - (see manual)

    - #### create_pvf

          void create_pvf(java.lang.String filename,
                          byte[] data,
                          java.lang.String optlist)
                   throws java.lang.Exception

      Create a named virtual read-only file from data provided in memory.
      Parameters:
        `filename` - The name of the virtual file
        `data` - Data for the virtual file
        `optlist` - An option list
      Throws:
        `java.lang.Exception` - (see manual)

    - #### delete_pvf

          int delete_pvf(java.lang.String filename)
                  throws java.lang.Exception

      Delete a named virtual file and free its data structures (but not the contents).
      Parameters:
        `filename` - The name of the virtual file.
      Returns:
        -1 if the virtual file exists but is locked, and 1 otherwise.
      Throws:
        `java.lang.Exception` - (see manual)

    - #### info_pvf

          double info_pvf(java.lang.String filename,
                          java.lang.String keyword)
                   throws java.lang.Exception

      Query properties of a virtual file or the PDFlib Virtual Filesystem (PVF).
      Parameters:
        `filename` - The name of the virtual file. The filename may be empty if keyword=filecount.
        `keyword` - A keyword for the requested information
      Returns:
        The value of some file parameter as requested by keyword.
      Throws:
        `java.lang.Exception` - (see manual)

    - #### convert_to_unicode

          java.lang.String convert_to_unicode(java.lang.String inputformat,
                                              byte[] inputstring,
                                              java.lang.String optlist)
                                       throws java.lang.Exception

      Convert a string in an arbitrary encoding to a Unicode string in various formats.
      Parameters:
        `inputformat` - Unicode text format or encoding name specifying interpretation of the input string
        `inputstring` - String to be converted to Unicode
        `optlist` - An option list specifying options for input interpretation and Unicode conversion
      Returns:
        The converted Unicode string.
      Throws:
        `java.lang.Exception` - (see manual)

    - #### delete

          void delete()

      Delete underlying object.

    - #### get_errmsg

          java.lang.String get_errmsg()

      Get the text of the last thrown exception or the reason of a failed function call.
      Returns:
        Text containing the description of the most recent error condition.

    - #### get_errnum

          int get_errnum()

      Get the number of the last thrown exception or the reason of a failed function call.
      Returns:
        The error code of the most recent error condition.

    - #### get_apiname

          java.lang.String get_apiname()

      Get the name of the API function which threw the last exception or failed.
      Returns:
        Name of an API function.