cete.dynamicpdf.xmp.pdfaschema
PdfASchema
- Namespace: ceTe.DynamicPDF.Xmp
- Assemblies: ceTe.DynamicPDF.40.dll
Class represents PdfA Schema.
public class PdfASchema : XmpSchema
Public Class PdfASchema
Inherits XmpSchema
Inheritance: Object → XmpSchema → PdfASchema
Examples
This example demonstrates the elements needed to specify a document as PDF/A-1b compatible.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.Xmp
Imports ceTe.DynamicPDF.Text
Module MyModule
Sub Main()
' Create a PDF Document
Dim MyDocument As Document = New Document
' Set Document Title Property
MyDocument.Title = "PDF/A1 Document"
' Create a XmpaMetadata instance
Dim MyXmp As XmpMetadata = New XmpMetadata()
' Add PDF/A schema with the conformance level.
Dim MyPdfaSchema As PdfASchema = New PdfASchema(PdfAStandard.PDF_A_1b_2005)
MyXmp.AddSchema(MyPdfaSchema)
Dim MyDc As DublinCoreSchema = MyXmp.DublinCore
MyDc.Title.AddLang("en-us", "PDF/A1 Document")
MyDocument.XmpMetadata = MyXmp
' Embedded iccprofile file.
Dim MyIccProfile As IccProfile = New IccProfile("C:\Temp\IccProfile\sRGB_IEC61966-2-1_noBPC.icc")
' Create Outputintent and add to documnet's outputIntents
Dim MyOutputIntents As OutputIntent = New OutputIntent("","IEC 61966-2.1 Default RGB colour space - sRGB 1 ","http://www.color.org","sRGB IEC61966-2.1 1",MyIccProfile)
MyOutputIntents.Version = OutputIntentVersion.PDF_A
MyDocument.OutputIntents.Add(MyOutputIntents)
Dim MyText As String = "Hello World"
' Create a Type1font
Dim MyType1Font As Type1Font = New Type1Font("C:\Temp\Type1\HELVETICA.PFM","C:\Temp\Type1\HELVETICA.PFB")
' Create a label using type1font
Dim MyLabel As Label = New Label(MyText,0,0,504,100,MyType1Font,18,TextAlign.Center,RgbColor.BlueViolet)
' Create a page
Dim MyPage As Page = New Page(PageSize.Letter,PageOrientation.Portrait,54.0f)
' Add label to the page
MyPage.Elements.Add(MyLabel)
' Add Page to the Document
MyDocument.Pages.Add(MyPage)
' Save the PDF document
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.Xmp;
using ceTe.DynamicPDF.Text;
class MyClass
{
static void Main()
{
// Create a PDF Document
Document document = new Document();
// Set Document Title Property
document.Title = "PDF/A1 Document";
// Create a XmpaMetadata instance
XmpMetadata xmp = new XmpMetadata();
// Add PDF/A schema with the conformance level.
PdfASchema pdfaschema = new PdfASchema(PdfAStandard.PDF_A_1b_2005);
xmp.AddSchema(pdfaschema);
DublinCoreSchema dc = xmp.DublinCore;
dc.Title.AddLang("en-us", "PDF/A1 Document");
document.XmpMetadata = xmp;
// Embedded iccprofile file
IccProfile iccProfile = new IccProfile(@"C:\Temp\IccProfile\sRGB_IEC61966-2-1_noBPC.icc");
// Create Outputintent and add to documnet's outputIntents
OutputIntent outputIntents = new OutputIntent("", "IEC 61966-2.1 Default RGB colour space - sRGB 1 ", "http://www.color.org", "sRGB IEC61966-2.1 1", iccProfile);
outputIntents.Version = OutputIntentVersion.PDF_A;
document.OutputIntents.Add(outputIntents);
string text = "Hello World";
// Create a Type1font
Type1Font type1Font = new Type1Font(@"C:\Temp\Type1\HELVETICA.PFM", @"C:\Temp\Type1\HELVETICA.PFB");
// Create a label using type1font
Label label = new Label(text, 0, 0, 504, 100, type1Font, 18, TextAlign.Center, RgbColor.BlueViolet);
// Create a page
Page page = new Page(PageSize.Letter, PageOrientation.Portrait, 54.0f);
// Add label to the page
page.Elements.Add(label);
// Add page to the document
document.Pages.Add(page);
// Save the PDF document
document.Draw( @"C:\MyDocument.pdf" );
}
}
Constructors
PdfASchema(PdfAStandard)
Initializes a new instance of the PdfASchema class.
public PdfASchema(PdfAStandard standard)
Public Sub New (standard As PdfAStandard)
Parameters
- standard: PdfAStandard
The PdfAStandard of conformance level.
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
- obj: Object
The Object to compare with the current Object .
Returns
true if the specified Object is equal to the current Object ; otherwise, false.
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 .
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.
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 .