GroupDocsGists
10/24/2017 - 1:55 PM

Examples-GroupDocs.Metadata-for-Java

Examples-GroupDocs.Metadata-for-Java

// shows how to use library in licensed mode using Dynabic.Metered account
public static void useDynabicMeteredAccount()
{
    // initialize Metered API
    Metered metered = new Metered();

    // set-up credentials
    try {
        metered.setMeteredKey(publicKey, privateKey);
    } catch (Exception e) {
        e.printStackTrace();
    }

    // do some work:

    // Open Word document
    DocFormat docFormat = new DocFormat(getStoragePath("Documents/Doc/sample.doc"));

    // remove hidden metadata
    docFormat.removeHiddenData(new DocInspectionOptions(DocInspectorOptionsEnum.All));

    // and get consumption quantity
    try {
        Double consumptionQuantity = Metered.getConsumptionQuantity();
    } catch (Exception e) {
        e.printStackTrace();
    }
}