OpenXmlSdkTs - v1.0.7
    Preparing search index...

    Class Utility

    Static helper utilities for working with Open XML packages.

    import { Utility } from "openxmlsdkts";

    const relsUri = Utility.getRelsPartUri(mainPart); // "/word/_rels/document.xml.rels"
    Utility.isBase64("UEsDBBQAAAA..."); // true
    Utility.isBase64("<?xml ..."); // false
    Index

    Constructors

    Methods

    • Computes the URI of the .rels file for a given part.

      Parameters

      Returns string

      The .rels URI string (e.g., "/word/_rels/document.xml.rels").

    • Heuristically determines whether a string is Base64-encoded.

      Parameters

      • str: unknown

        The value to test.

      Returns boolean

      true if the string appears to be Base64-encoded.

      Checks the first 500 characters for valid Base64 characters (A-Z, a-z, 0-9, +, /). Used by OpenXmlPackage.open to distinguish Base64 strings from Flat OPC XML.