Skip to main content

BasicSchema

Version: 12.0

cete.dynamicpdf.xmp.basicschema

BasicSchema​

Class represents the XMP Basic Schema.

public class BasicSchema : XmpSchema
Public Class BasicSchema
Inherits XmpSchema

Inheritance: Object → XmpSchema → BasicSchema

Licensing Info​

This class is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Examples​

This example shows how to create an Basic Schema and Add it to the Xmp Metadata.

Imports System
Imports System.IO
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.Xmp

Module MyModule

Sub Main()

' Create a PDF Document
Dim MyDocument As Document = New Document

' Add blank pages to the document
MyDocument.Pages.Add(New Page(PageSize.Letter))
MyDocument.Pages.Add(New Page(PageSize.Letter))

' Create an Xmp Metadata
Dim MyXmp As XmpMetadata = New XmpMetadata

' Basic Schema.
Dim Mybs As BasicSchema = MyXmp.BasicSchema
Mybs.Advisory.Add("Date")
Mybs.Advisory.Add("Contributors")
Mybs.Nickname = "xyz"
Mybs.Thumbnails.Add(106, 80, "JPEG", GetImage("C:\thumbnail.jpg"))
' Note: Need not have to add Basic Schema, already added internally.

' Add the Xmp Metadata to the document
MyDocument.XmpMetadata = MyXmp

' Save the PDF document
MyDocument.Draw("C:\MyDocument.pdf")

End Sub

Private Function GetImage(ByVal filePath As String) As Byte()

Dim MyInFile As FileStream = New FileStream(filePath, FileMode.Open, FileAccess.Read)
Dim MyBinaryData(MyInFile.Length) As Byte
MyInFile.Read(MyBinaryData, 0, MyInFile.Length)
MyInFile.Close()
return MyBinaryData

End Function

End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.xmp;

public class Example
{
public static void CreatePDF(string outputPath, string imagePath)
{
// Create a PDF Document
Document document = new Document();

// Add blank pages to the document
document.Pages.Add(new Page(PageSize.Letter));
document.Pages.Add(new Page(PageSize.Letter));

// Create an Xmp Metadata
XmpMetadata xmp = new XmpMetadata();

// Basic Schema.
BasicSchema bs = xmp.BasicSchema;
bs.Advisory.Add("Date");
bs.Advisory.Add("Contributors");
bs.Nickname = "xyz";
bs.Thumbnails.Add(106, 80, "JPEG", GetImage(imagePath));
// Note: Need not have to add Basic Schema, already added internally.

// Add the Xmp Metadata to the document
document.XmpMetadata = xmp;

// Save the PDF
document.Draw(outputPath);
}

private static byte[] GetImage(string filePath)
{
FileStream inFile = new FileStream(filePath, FileMode.Open, FileAccess.Read);
byte[] binaryData = new byte[inFile.Length];
inFile.Read(binaryData, 0, (int)inFile.Length);
inFile.Close();
return binaryData;
}
}

Remarks​

The XMP Basic Schema contains properties that provide basic descriptive information.

Properties​

Advisory​

Gets the XmpArray object to set the advisory property to specify properties that were edited outside the authoring application.

public XmpArray Advisory { get; }
Public Property Advisory As XmpArray

Property Value​

XmpArray

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Nickname​

Gets or sets a short informal name for the resource.

public string Nickname { get; set; }
Public Property Nickname As String

Property Value​

String

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Thumbnails​

Gets the XmpThumbnail object to set an alternative array of thumbnail images for a file, which can differ in characteristics such as size or image encoding.

public XmpThumbnail Thumbnails { get; }
Public Property Thumbnails As XmpThumbnail

Property Value​

XmpThumbnail

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Methods​

Equals(Object)​

Determines whether the specified Object is equal to the current Object . (Inherited from Object)

public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean

Parameters​

The Object to compare with the current Object .

Returns​

true if the specified Object is equal to the current Object ; otherwise, false.

Licensing Info​

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

GetHashCode()​

Serves as a hash function for a particular type. (Inherited from Object)

public int GetHashCode()
Function GetHashCode() As Integer

Returns​

A hash code for the current Object .

Licensing Info​

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

GetType()​

Gets the Type of the current instance. (Inherited from Object)

public Type GetType()
Function GetType() As Type

Returns​

The Type instance that represents the exact runtime type of the current instance.

Licensing Info​

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

ToString()​

Returns a String that represents the current Object . (Inherited from Object)

public string ToString()
Function ToString() As String

Returns​

A String that represents the current Object .

Licensing Info​

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

See Also​

ceTe.DynamicPDF.Xmp