Struct PdfVersion
Represents the PDF file version (spec §7.5.2).
The version is declared in the file header as %PDF-x.y.
Implements
Inherited Members
Namespace: DRIT.Pdf
Assembly: DRIT.Pdf.dll
Syntax
public readonly struct PdfVersion : IEquatable<PdfVersion>
Constructors
PdfVersion(int, int)
Initializes a new PDF version.
Declaration
public PdfVersion(int major, int minor)
Parameters
| Type | Name | Description |
|---|---|---|
| int | major | |
| int | minor |
Fields
V1_4
PDF 1.4 (used for PDF/A-1b).
Declaration
public static readonly PdfVersion V1_4
Field Value
| Type | Description |
|---|---|
| PdfVersion |
V1_5
PDF 1.5 (introduces xref streams and object streams).
Declaration
public static readonly PdfVersion V1_5
Field Value
| Type | Description |
|---|---|
| PdfVersion |
V1_6
PDF 1.6 (used for PDF/X-4).
Declaration
public static readonly PdfVersion V1_6
Field Value
| Type | Description |
|---|---|
| PdfVersion |
V1_7
PDF 1.7 (ISO 32000-1:2008 — default for DRIT.Pdf).
Declaration
public static readonly PdfVersion V1_7
Field Value
| Type | Description |
|---|---|
| PdfVersion |
V2_0
PDF 2.0 (ISO 32000-2:2020).
Declaration
public static readonly PdfVersion V2_0
Field Value
| Type | Description |
|---|---|
| PdfVersion |
Properties
Header
The header string (e.g. "%PDF-1.7").
Declaration
public string Header { get; }
Property Value
| Type | Description |
|---|---|
| string |
Major
Major version number (e.g. 1).
Declaration
public int Major { get; }
Property Value
| Type | Description |
|---|---|
| int |
Minor
Minor version number (e.g. 7).
Declaration
public int Minor { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
Equals(PdfVersion)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(PdfVersion other)
Parameters
| Type | Name | Description |
|---|---|---|
| PdfVersion | other | An object to compare with this object. |
Returns
| Type | Description |
|---|---|
| bool | true if the current object is equal to the |
Equals(object?)
Indicates whether this instance and a specified object are equal.
Declaration
public override bool Equals(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare with the current instance. |
Returns
| Type | Description |
|---|---|
| bool | true if |
Overrides
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A 32-bit signed integer that is the hash code for this instance. |
Overrides
ToString()
The version string (e.g. "1.7").
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string |
Overrides
Operators
operator ==(PdfVersion, PdfVersion)
Equality operator.
Declaration
public static bool operator ==(PdfVersion a, PdfVersion b)
Parameters
| Type | Name | Description |
|---|---|---|
| PdfVersion | a | |
| PdfVersion | b |
Returns
| Type | Description |
|---|---|
| bool |
operator !=(PdfVersion, PdfVersion)
Inequality operator.
Declaration
public static bool operator !=(PdfVersion a, PdfVersion b)
Parameters
| Type | Name | Description |
|---|---|---|
| PdfVersion | a | |
| PdfVersion | b |
Returns
| Type | Description |
|---|---|
| bool |