Skip to main content

XmpDublinCoreSchema Class

The Dublin Core metadata schema in an XMP document.

Declaration

public class XmpDublinCoreSchema extends JavaObject

Remarks

The following code snippet creates a tagged PDF document, configures PDF/UA metadata, and specifies marked content information through the MarkInfo class. The code snippet enables marked content, user properties, and disables the suspects flag before saving the document.

package pdf;

import com.devexpress.docs.pdf.*;
import com.devexpress.system.drawing.*;
import com.devexpress.drawing.printing.*;

import java.io.*;
import java.util.*;
import java.nio.file.*;

public class Main {
    public static void main(String[] args) throws Exception {
        try (PdfDocument document = new PdfDocument()) {
            Locale documentLocale = Locale.forLanguageTag("en-US");
            String title = "Invoice";

            // Specify PDF/UA metadata.
            document.getMetadata().getXmp()
                    .getXmpPdfUASchema()
                    .setPart(new XmpInteger(1));

            document.getMetadata().getXmp()
                    .getXmpDublinCoreSchema()
                    .getTitle()
                    .add(documentLocale.toLanguageTag(), title);

            // Specify marked content information.
            MarkInfo markInfo = document.getMarkInfo();
            markInfo.setMarked(true);
            markInfo.setUserProperties(true);
            markInfo.setSuspects(false);

            Page page = document.getPages().add(DXPaperKind.A4);

            // Create the root Document structure element.
            StructureElement root = document.getStructureTree()
                    .addChildElement(Pdf17StructureType.DOCUMENT);

            // Add a section to the document structure.
            StructureElement section = root.addChildElement(Pdf17StructureType.SECT);

            // Add a heading element.
            StructureElement heading = section.addChildElement(Pdf17StructureType.H1);
            heading.addFragment(page, new TextFragment() {{
                setText(title);
                setLocation(new PointF(50, 800));
                setFont(new TextFont("Arial", TextFontStyle.BOLD));
                setFontSize(24);
            }});

            // Add a paragraph element.
            StructureElement paragraph = section.addChildElement(Pdf17StructureType.P);
            paragraph.addFragment(page, new TextFragment() {{
                setText("Invoice details");
                setLocation(new PointF(50, 760));
            }});

            // Save the tagged PDF document.
            try (OutputStream stream =
                         Files.newOutputStream(
                                 Path.of("TaggedDocument.pdf"))) {
                document.save(stream);
            }
        }
    }
}

Refer to the following help topic for additional information: Create a Structure Tree for a New PDF Document.

Inherited Members

com.devexpress.system.JavaObject.clone()
com.devexpress.system.JavaObject.equals(java.lang.Object)
com.devexpress.system.JavaObject.hashCode()
com.devexpress.system.JavaObject.initFields()
com.devexpress.system.JavaObject.memberwiseClone()
com.devexpress.system.JavaObject.toString()
java.lang.Object.finalize()
java.lang.Object.getClass()
java.lang.Object.notify()
java.lang.Object.notifyAll()
java.lang.Object.wait()
java.lang.Object.wait(long)
java.lang.Object.wait(long,int)

Inheritance

Object
com.devexpress.system.JavaObject
XmpDublinCoreSchema

Methods

getContributor() Method

Returns the contributors to the document.

Declaration

public IXmpStringArray getContributor()

Returns

Type Description
IXmpStringArray

The list of document contributors.

getCoverage() Method

Returns the coverage metadata.

Declaration

public XmpString getCoverage()

Returns

Type Description
XmpString

The spatial or temporal coverage of the resource.

getCreator() Method

Returns the creators of the document.

Declaration

public IXmpStringArray getCreator()

Returns

Type Description
IXmpStringArray

The list of document creators.

getDate() Method

Returns the date metadata.

Declaration

public IXmpDateArray getDate()

Returns

Type Description
IXmpDateArray

The array of dates associated with the document.

getDescription() Method

Returns the description metadata.

Declaration

public IXmpLangAlt getDescription()

Returns

Type Description
IXmpLangAlt

The localized description metadata.

getFormat() Method

Returns the file format metadata.

Declaration

public XmpString getFormat()

Returns

Type Description
XmpString

The file format metadata.

getIdentifier() Method

Returns the identifier metadata.

Declaration

public XmpString getIdentifier()

Returns

Type Description
XmpString

The unique identifier of the resource.

getLanguage() Method

Returns languages associated with the resource.

Declaration

public IXmpStringArray getLanguage()

Returns

Type Description
IXmpStringArray

The list of resource languages.

getPublisher() Method

Returns the publishers of the document.

Declaration

public IXmpStringArray getPublisher()

Returns

Type Description
IXmpStringArray

The list of document publishers.

getRelation() Method

Returns related resources.

Declaration

public IXmpStringArray getRelation()

Returns

Type Description
IXmpStringArray

The list of related resources.

getRights() Method

Returns the rights metadata.

Declaration

public IXmpLangAlt getRights()

Returns

Type Description
IXmpLangAlt

The localized rights metadata.

getSource() Method

Returns the source metadata.

Declaration

public XmpString getSource()

Returns

Type Description
XmpString

The source of the resource.

getSubject() Method

Returns the subject metadata.

Declaration

public IXmpStringArray getSubject()

Returns

Type Description
IXmpStringArray

The list of document subjects.

getTitle() Method

Returns the title metadata.

Declaration

public IXmpLangAlt getTitle()

Returns

Type Description
IXmpLangAlt

The localized title metadata.

getType() Method

Returns resource types.

Declaration

public IXmpStringArray getType()

Returns

Type Description
IXmpStringArray

The list of resource types.

setCoverage(XmpString value) Method

Sets the resource coverage metadata.

Declaration

public void setCoverage(XmpString value)

Parameters

Name Type Description
value XmpString

The coverage metadata to assign.

setFormat(XmpString value) Method

Sets the file format metadata.

Declaration

public void setFormat(XmpString value)

Parameters

Name Type Description
value XmpString

The file format metadata to assign.

setIdentifier(XmpString value) Method

Sets the resource identifier metadata.

Declaration

public void setIdentifier(XmpString value)

Parameters

Name Type Description
value XmpString

The identifier metadata to assign.

setSource(XmpString value) Method

Sets the resource source metadata.

Declaration

public void setSource(XmpString value)

Parameters

Name Type Description
value XmpString

The source metadata to assign.