Package com.pd4ml
Class PdfSpec
- java.lang.Object
-
- com.pd4ml.PdfSpec
-
public final class PdfSpec extends java.lang.ObjectA PDF output specification: a PDF version, optionally combined with conformance to PDF/A (archiving), PDF/UA (accessibility) or an e-invoice format. Pass it toPD4ML.writePDF(java.io.OutputStream, PdfSpec).Start from a PDF version constant and add standards with
combine(PdfSpec):
Each PDF/A part requires a minimum PDF version: PDF 1.4 for PDF/A-1, PDF 1.7 for PDF/A-2 and PDF/A-3, PDF 2.0 for PDF/A-4. PDF/UA-1 requires PDF 1.4, PDF/UA-2 requires PDF 2.0. PDF/UA can only be combined with the accessible "a" level of PDF/A-1 to PDF/A-3, and PDF/UA-2 not with PDF/A-1 to PDF/A-3 at all. Instances are immutable;pd4ml.writePDF(os, PdfSpec.PDF_1_7); // plain PDF 1.7 pd4ml.writePDF(os, PdfSpec.PDF_1_7.combine(PdfSpec.PDFA_3B)); // PDF/A-3b pd4ml.writePDF(os, PdfSpec.PDF_1_7.combine(PdfSpec.PDFA_2A) .combine(PdfSpec.PDFUA_1)); // PDF/A-2a + PDF/UA-1 pd4ml.writePDF(os, PdfSpec.ZUGFeRD); // ZUGFeRD invoicecombine(PdfSpec)returns a new one.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPdfSpec.PdfSpecUnsupportedExceptionThrown when a requested PDF version or standard is not supported.static classPdfSpec.PdfSpecViolationExceptionThrown when standards are combined in a way the specifications do not allow.
-
Field Summary
Fields Modifier and Type Field Description static PdfSpecFacturXFactur-X electronic invoice profile: PDF 1.7 and PDF/A-3b.static PdfSpecFacturX_aFactur-X electronic invoice profile, tagged: PDF 1.7 and PDF/A-3a.intidThe internal identifier: 100 to 200 for PDF versions (PDF 1.4 is 140), 1 to 22 for PDF/A and PDF/UA.java.lang.StringnameThe name of the specification, for example "1.7" or "PDF/A-3b"; seetoString().static PdfSpecPDF_1_0PDF 1.0 / Acrobat 1.static PdfSpecPDF_1_1PDF 1.1 / Acrobat 2.static PdfSpecPDF_1_2PDF 1.2 / Acrobat 3.static PdfSpecPDF_1_3PDF 1.3 / Acrobat 4.static PdfSpecPDF_1_4PDF 1.4 / Acrobat 5.static PdfSpecPDF_1_5PDF 1.5 / Acrobat 6static PdfSpecPDF_1_6PDF 1.6 / Acrobat 7static PdfSpecPDF_1_7PDF 1.7 / Acrobat 8 / ISO 32000-1.static PdfSpecPDF_1_7_1PDF 1.7 unofficial ext level 1static PdfSpecPDF_1_7_10PDF 1.7 unofficial ext level 10static PdfSpecPDF_1_7_11PDF 1.7 extension level 11 / Acrobat XIstatic PdfSpecPDF_1_7_2PDF 1.7 unofficial ext level 2static PdfSpecPDF_1_7_3PDF 1.7 extension level 3 / Acrobat 9static PdfSpecPDF_1_7_4PDF 1.7 unofficial ext level 4static PdfSpecPDF_1_7_5PDF 1.7 extension level 5static PdfSpecPDF_1_7_6PDF 1.7 unofficial ext level 6static PdfSpecPDF_1_7_7PDF 1.7 unofficial ext level 7static PdfSpecPDF_1_7_8PDF 1.7 extension level 8 / Acrobat Xstatic PdfSpecPDF_1_7_9PDF 1.7 unofficial ext level 9static PdfSpecPDF_2_0PDF 2.0 / ISO 32000-2static PdfSpecPDFA_1APDF/A-1a (ISO 19005-1, level a): archivable and accessible; tagged structure and Unicode text required; no transparency.static PdfSpecPDFA_1BPDF/A-1b (ISO 19005-1, level b): archivable with a reliable visual appearance; no transparency.static PdfSpecPDFA_2APDF/A-2a (ISO 19005-2, level a): archivable and accessible; tagged structure and Unicode text required.static PdfSpecPDFA_2BPDF/A-2b (ISO 19005-2, level b): archivable with a reliable visual appearance.static PdfSpecPDFA_2UPDF/A-2u (ISO 19005-2, level u): like PDF/A-2b, plus Unicode text that can be extracted reliably.static PdfSpecPDFA_3APDF/A-3a (ISO 19005-3, level a): like PDF/A-2a, and allows embedded files of any type.static PdfSpecPDFA_3BPDF/A-3b (ISO 19005-3, level b): like PDF/A-2b, and allows embedded files of any type.static PdfSpecPDFA_3UPDF/A-3u (ISO 19005-3, level u): like PDF/A-2u, and allows embedded files of any type.static PdfSpecPDFA_4PDF/A-4 (ISO 19005-4), based on PDF 2.0.static PdfSpecPDFA_4EPDF/A-4e (ISO 19005-4), for engineering documents, based on PDF 2.0.static PdfSpecPDFUA_1PDF/UA-1 (ISO 14289-1): universally accessible PDF, for example for screen readers; a tagged structure is generated.static PdfSpecPDFUA_2PDF/UA-2 (ISO 14289-2), based on PDF 2.0.intxidThe internal bit mask of the PDF/A and PDF/UA standards included.static PdfSpecZUGFeRDZUGFeRD electronic invoice profile: PDF 1.7 and PDF/A-3b.static PdfSpecZUGFeRD_aZUGFeRD electronic invoice profile, tagged: PDF 1.7 and PDF/A-3a.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowsAttachments()Tells whether the specification allows embedded files attached to the content (not allowed by PDF/A-1 and PDF/A-2).booleanallowsDocLevelAttachments()Tells whether the specification allows files embedded at document level, as used by e-invoices (allowed by PDF/A-3 and PDF 2.0).booleanallowsEncryption()Tells whether the specification allows encryption (not allowed by PDF/A).booleanallowsExternalHyperlinking()Tells whether the specification allows links to external resources.booleanallowsPdfForms()Tells whether PD4ML generates interactive form fields for this specification (not for PDF/A).booleanallowsTransparency()Tells whether the specification allows transparency (not allowed by PDF/A-1).static booleanareCompatible(PdfSpec pdf, PdfSpec pdfa1, PdfSpec pdfa2)Checks whether a PDF version and up to two PDF/A or PDF/UA standards can be combined: PDF/A-4 needs PDF 1.7 or later, and PDF/UA-2 cannot be combined with PDF/A-1 to PDF/A-3.PdfSpeccombine(PdfSpec spec)Returns a new specification that adds a PDF/A or PDF/UA standard to this one.static PdfSpecgetByID(int id)Finds a PDF/A or PDF/UA constant by itsid.static PdfSpecgetByLabel(java.lang.String label)Finds a PDF version by its version number.static PdfSpecgetInstance(java.lang.String label)Finds a specification constant by its name, as returned bytoString(), ignoring case: for example "1.4", "1.7ext3", "PDF/A-3b", "PDF/UA-1" or "Factur-X".intgetPdfaVersion()Returns the PDF/A part the specification includes.intgetPdfExtLevel()Returns the Adobe extension level of a PDF 1.7 specification.intgetPdfuaVersion()java.lang.StringgetPdfVersionLabel()Returns the PDF version of a version specification, without the extension level.booleanisPdfa()Tells whether the specification includes any PDF/A part and level.booleanisPdfa1()Tells whether the specification includes PDF/A-1 (level a or b).booleanisPdfa12()Tells whether the specification includes PDF/A-1 or PDF/A-2 (any level).booleanisPdfa123()Tells whether the specification includes PDF/A-1, PDF/A-2 or PDF/A-3 (any level).booleanisPdfa1234()Tells whether the specification includes any PDF/A part from 1 to 4.booleanisPdfa123a()Tells whether the specification includes PDF/A-1a, PDF/A-2a or PDF/A-3a.booleanisPdfa123b()Tells whether the specification includes PDF/A-1b, PDF/A-2b or PDF/A-3b.booleanisPdfa12a()Tells whether the specification includes PDF/A-1a or PDF/A-2a.booleanisPdfa1a()Tells whether the specification includes PDF/A-1a.booleanisPdfa1b()Tells whether the specification includes PDF/A-1b.booleanisPdfa2()Tells whether the specification includes PDF/A-2 (any level).booleanisPdfa23()Tells whether the specification includes PDF/A-2 or PDF/A-3 (any level).booleanisPdfa234()Tells whether the specification includes PDF/A-2, PDF/A-3 or PDF/A-4.booleanisPdfa23a()Tells whether the specification includes PDF/A-2a or PDF/A-3a.booleanisPdfa23b()Tells whether the specification includes PDF/A-2b or PDF/A-3b.booleanisPdfa23u()Tells whether the specification includes PDF/A-2u or PDF/A-3u.booleanisPdfa2u()Tells whether the specification includes PDF/A-2u.booleanisPdfa3()Tells whether the specification includes PDF/A-3 (any level).booleanisPdfa4()Tells whether the specification includes PDF/A-4 (any variant).booleanisPdfa4e()Tells whether the specification includes PDF/A-4e.booleanisPdfa4f()Tells whether the specification includes PDF/A-4f (not supported yet).booleanisPdfua()Tells whether the specification includes PDF/UA-1 or PDF/UA-2.booleanisPdfua1()Tells whether the specification includes PDF/UA-1.booleanisPdfua2()Tells whether the specification includes PDF/UA-2.static java.lang.StringlistKeywords()Lists the names of the supported specifications from PDF 1.4 on, for help texts: PDF versions are prefixed with "PDF" (for example 'PDF1.7'), the others are listed as they are (for example 'PDF/A-3b').booleanrequiresColorspace()Tells whether the specification requires a device-independent color space or output intent for the colors used.booleanrequiresMetadata()Tells whether the specification requires XMP metadata (PDF/A and PDF/UA).booleanrequiresOutputInternet()Tells whether the specification requires an output intent (PDF/A and PDF/UA).booleanrequiresReliableUnicodeSemantics()Tells whether the specification requires every glyph to map to Unicode text (PDF/A-1).booleanrequiresTagging()Tells whether the specification requires a tagged PDF with a logical structure tree (PDF/A-1a, -2a, -3a and PDF/UA).java.lang.StringtoString()Returns the name of the specification, for example "1.7", "PDF/A-3b" or "ZUGFeRD".PdfSpecwithMinimumVersion(PdfSpec version)Returns a specification with at least the given PDF version, keeping the PDF/A and PDF/UA standards of this one.
-
-
-
Field Detail
-
PDF_1_0
public static final PdfSpec PDF_1_0
PDF 1.0 / Acrobat 1. Obsolete; not supported for output.
-
PDF_1_1
public static final PdfSpec PDF_1_1
PDF 1.1 / Acrobat 2. Obsolete; not supported for output.
-
PDF_1_2
public static final PdfSpec PDF_1_2
PDF 1.2 / Acrobat 3. Obsolete; not supported for output.
-
PDF_1_3
public static final PdfSpec PDF_1_3
PDF 1.3 / Acrobat 4. Obsolete; not supported for output.
-
PDF_1_4
public static final PdfSpec PDF_1_4
PDF 1.4 / Acrobat 5. The lowest version supported for output.
-
PDF_1_5
public static final PdfSpec PDF_1_5
PDF 1.5 / Acrobat 6
-
PDF_1_6
public static final PdfSpec PDF_1_6
PDF 1.6 / Acrobat 7
-
PDF_1_7
public static final PdfSpec PDF_1_7
PDF 1.7 / Acrobat 8 / ISO 32000-1. The default output version.
-
PDF_1_7_1
public static final PdfSpec PDF_1_7_1
PDF 1.7 unofficial ext level 1
-
PDF_1_7_2
public static final PdfSpec PDF_1_7_2
PDF 1.7 unofficial ext level 2
-
PDF_1_7_3
public static final PdfSpec PDF_1_7_3
PDF 1.7 extension level 3 / Acrobat 9
-
PDF_1_7_4
public static final PdfSpec PDF_1_7_4
PDF 1.7 unofficial ext level 4
-
PDF_1_7_5
public static final PdfSpec PDF_1_7_5
PDF 1.7 extension level 5
-
PDF_1_7_6
public static final PdfSpec PDF_1_7_6
PDF 1.7 unofficial ext level 6
-
PDF_1_7_7
public static final PdfSpec PDF_1_7_7
PDF 1.7 unofficial ext level 7
-
PDF_1_7_8
public static final PdfSpec PDF_1_7_8
PDF 1.7 extension level 8 / Acrobat X
-
PDF_1_7_9
public static final PdfSpec PDF_1_7_9
PDF 1.7 unofficial ext level 9
-
PDF_1_7_10
public static final PdfSpec PDF_1_7_10
PDF 1.7 unofficial ext level 10
-
PDF_1_7_11
public static final PdfSpec PDF_1_7_11
PDF 1.7 extension level 11 / Acrobat XI
-
PDF_2_0
public static final PdfSpec PDF_2_0
PDF 2.0 / ISO 32000-2
-
PDFA_1A
public static final PdfSpec PDFA_1A
PDF/A-1a (ISO 19005-1, level a): archivable and accessible; tagged structure and Unicode text required; no transparency. Requires PDF 1.4 or later.
-
PDFA_1B
public static final PdfSpec PDFA_1B
PDF/A-1b (ISO 19005-1, level b): archivable with a reliable visual appearance; no transparency. Requires PDF 1.4 or later.
-
PDFA_2A
public static final PdfSpec PDFA_2A
PDF/A-2a (ISO 19005-2, level a): archivable and accessible; tagged structure and Unicode text required. Requires PDF 1.7.
-
PDFA_2B
public static final PdfSpec PDFA_2B
PDF/A-2b (ISO 19005-2, level b): archivable with a reliable visual appearance. Requires PDF 1.7.
-
PDFA_2U
public static final PdfSpec PDFA_2U
PDF/A-2u (ISO 19005-2, level u): like PDF/A-2b, plus Unicode text that can be extracted reliably. Requires PDF 1.7.
-
PDFA_3A
public static final PdfSpec PDFA_3A
PDF/A-3a (ISO 19005-3, level a): like PDF/A-2a, and allows embedded files of any type. Requires PDF 1.7.
-
PDFA_3B
public static final PdfSpec PDFA_3B
PDF/A-3b (ISO 19005-3, level b): like PDF/A-2b, and allows embedded files of any type. Requires PDF 1.7.
-
PDFA_3U
public static final PdfSpec PDFA_3U
PDF/A-3u (ISO 19005-3, level u): like PDF/A-2u, and allows embedded files of any type. Requires PDF 1.7.
-
PDFA_4
public static final PdfSpec PDFA_4
PDF/A-4 (ISO 19005-4), based on PDF 2.0. Requires PDF 2.0.
-
PDFA_4E
public static final PdfSpec PDFA_4E
PDF/A-4e (ISO 19005-4), for engineering documents, based on PDF 2.0. Requires PDF 2.0.
-
PDFUA_1
public static final PdfSpec PDFUA_1
PDF/UA-1 (ISO 14289-1): universally accessible PDF, for example for screen readers; a tagged structure is generated. Combine it with a PDF version from 1.4 on, optionally also with PDF/A-1a, -2a or -3a.
-
PDFUA_2
public static final PdfSpec PDFUA_2
PDF/UA-2 (ISO 14289-2), based on PDF 2.0. Requires PDF 2.0; cannot be combined with PDF/A-1 to PDF/A-3.
-
ZUGFeRD
public static final PdfSpec ZUGFeRD
ZUGFeRD electronic invoice profile: PDF 1.7 and PDF/A-3b. Use it directly, withoutcombine(PdfSpec).
-
ZUGFeRD_a
public static final PdfSpec ZUGFeRD_a
ZUGFeRD electronic invoice profile, tagged: PDF 1.7 and PDF/A-3a. Use it directly, withoutcombine(PdfSpec).
-
FacturX
public static final PdfSpec FacturX
Factur-X electronic invoice profile: PDF 1.7 and PDF/A-3b. Use it directly, withoutcombine(PdfSpec).
-
FacturX_a
public static final PdfSpec FacturX_a
Factur-X electronic invoice profile, tagged: PDF 1.7 and PDF/A-3a. Use it directly, withoutcombine(PdfSpec).
-
name
public java.lang.String name
The name of the specification, for example "1.7" or "PDF/A-3b"; seetoString().
-
id
public int id
The internal identifier: 100 to 200 for PDF versions (PDF 1.4 is 140), 1 to 22 for PDF/A and PDF/UA.
-
xid
public int xid
The internal bit mask of the PDF/A and PDF/UA standards included.
-
-
Constructor Detail
-
PdfSpec
public PdfSpec(PdfSpec spec) throws PdfSpec.PdfSpecViolationException, PdfSpec.PdfSpecUnsupportedException
Creates the specification of the PDF version a given specification needs: a PDF version is copied; for a PDF/A or PDF/UA constant, the result is the lowest PDF version that standard allows, combined with the standard. For example,new PdfSpec(PdfSpec.PDFA_3B)is equivalent toPdfSpec.PDF_1_7.combine(PdfSpec.PDFA_3B).- Parameters:
spec- a PDF version, PDF/A or PDF/UA constant- Throws:
PdfSpec.PdfSpecViolationException- declared for compatibility; not thrown by this constructorPdfSpec.PdfSpecUnsupportedException- ifspecis a PDF version before 1.4, or is not a known version or standard
-
-
Method Detail
-
toString
public java.lang.String toString()
Returns the name of the specification, for example "1.7", "PDF/A-3b" or "ZUGFeRD". For a combined specification, the name of the PDF version it is based on.- Overrides:
toStringin classjava.lang.Object- Returns:
- the name
-
combine
public PdfSpec combine(PdfSpec spec) throws PdfSpec.PdfSpecViolationException, PdfSpec.PdfSpecUnsupportedException
Returns a new specification that adds a PDF/A or PDF/UA standard to this one. This object is not changed.Allowed combinations: a PDF version with one PDF/A part and level, a PDF version with PDF/UA, and a PDF version with PDF/UA and an "a" level of PDF/A-1 to PDF/A-3. The PDF version must be high enough for the standard (see the class description).
- Parameters:
spec- the PDF/A or PDF/UA standard to add- Returns:
- the combined specification
- Throws:
PdfSpec.PdfSpecViolationException- if the combination is not allowed:specis a PDF version (the version cannot be changed), the PDF version is too low forspec, a PDF/A level is already set, or PDF/UA would be combined with a PDF/A level other than "a"PdfSpec.PdfSpecUnsupportedException- ifspecis a PDF version before 1.4
-
withMinimumVersion
public PdfSpec withMinimumVersion(PdfSpec version)
Returns a specification with at least the given PDF version, keeping the PDF/A and PDF/UA standards of this one. This object is not changed.- Parameters:
version- a PDF version constant, for examplePDF_1_6- Returns:
- this object if its PDF version is already high enough, a raised copy otherwise
-
isPdfa
public boolean isPdfa()
Tells whether the specification includes any PDF/A part and level.- Returns:
trueif it does
-
isPdfa1
public boolean isPdfa1()
Tells whether the specification includes PDF/A-1 (level a or b).- Returns:
trueif it does
-
isPdfa1a
public boolean isPdfa1a()
Tells whether the specification includes PDF/A-1a.- Returns:
trueif it does
-
isPdfa1b
public boolean isPdfa1b()
Tells whether the specification includes PDF/A-1b.- Returns:
trueif it does
-
isPdfa2
public boolean isPdfa2()
Tells whether the specification includes PDF/A-2 (any level).- Returns:
trueif it does
-
isPdfa3
public boolean isPdfa3()
Tells whether the specification includes PDF/A-3 (any level).- Returns:
trueif it does
-
isPdfa12
public boolean isPdfa12()
Tells whether the specification includes PDF/A-1 or PDF/A-2 (any level).- Returns:
trueif it does
-
isPdfa12a
public boolean isPdfa12a()
Tells whether the specification includes PDF/A-1a or PDF/A-2a.- Returns:
trueif it does
-
isPdfa2u
public boolean isPdfa2u()
Tells whether the specification includes PDF/A-2u.- Returns:
trueif it does
-
isPdfa123
public boolean isPdfa123()
Tells whether the specification includes PDF/A-1, PDF/A-2 or PDF/A-3 (any level).- Returns:
trueif it does
-
isPdfa123a
public boolean isPdfa123a()
Tells whether the specification includes PDF/A-1a, PDF/A-2a or PDF/A-3a.- Returns:
trueif it does
-
isPdfa23
public boolean isPdfa23()
Tells whether the specification includes PDF/A-2 or PDF/A-3 (any level).- Returns:
trueif it does
-
isPdfa23a
public boolean isPdfa23a()
Tells whether the specification includes PDF/A-2a or PDF/A-3a.- Returns:
trueif it does
-
isPdfa23b
public boolean isPdfa23b()
Tells whether the specification includes PDF/A-2b or PDF/A-3b.- Returns:
trueif it does
-
isPdfa23u
public boolean isPdfa23u()
Tells whether the specification includes PDF/A-2u or PDF/A-3u.- Returns:
trueif it does
-
isPdfa123b
public boolean isPdfa123b()
Tells whether the specification includes PDF/A-1b, PDF/A-2b or PDF/A-3b.- Returns:
trueif it does
-
isPdfa4e
public boolean isPdfa4e()
Tells whether the specification includes PDF/A-4e.- Returns:
trueif it does
-
isPdfa4f
public boolean isPdfa4f()
Tells whether the specification includes PDF/A-4f (not supported yet).- Returns:
trueif it does
-
isPdfa4
public boolean isPdfa4()
Tells whether the specification includes PDF/A-4 (any variant).- Returns:
trueif it does
-
isPdfa1234
public boolean isPdfa1234()
Tells whether the specification includes any PDF/A part from 1 to 4.- Returns:
trueif it does
-
isPdfa234
public boolean isPdfa234()
Tells whether the specification includes PDF/A-2, PDF/A-3 or PDF/A-4.- Returns:
trueif it does
-
isPdfua
public boolean isPdfua()
Tells whether the specification includes PDF/UA-1 or PDF/UA-2.- Returns:
trueif it does
-
isPdfua1
public boolean isPdfua1()
Tells whether the specification includes PDF/UA-1.- Returns:
trueif it does
-
isPdfua2
public boolean isPdfua2()
Tells whether the specification includes PDF/UA-2.- Returns:
trueif it does
-
allowsTransparency
public boolean allowsTransparency()
Tells whether the specification allows transparency (not allowed by PDF/A-1).- Returns:
trueif transparency is allowed
-
allowsAttachments
public boolean allowsAttachments()
Tells whether the specification allows embedded files attached to the content (not allowed by PDF/A-1 and PDF/A-2).- Returns:
trueif attachments are allowed
-
allowsDocLevelAttachments
public boolean allowsDocLevelAttachments()
Tells whether the specification allows files embedded at document level, as used by e-invoices (allowed by PDF/A-3 and PDF 2.0).- Returns:
trueif document-level attachments are allowed
-
allowsEncryption
public boolean allowsEncryption()
Tells whether the specification allows encryption (not allowed by PDF/A).- Returns:
trueif encryption is allowed
-
allowsPdfForms
public boolean allowsPdfForms()
Tells whether PD4ML generates interactive form fields for this specification (not for PDF/A).- Returns:
trueif form fields are allowed
-
requiresTagging
public boolean requiresTagging()
Tells whether the specification requires a tagged PDF with a logical structure tree (PDF/A-1a, -2a, -3a and PDF/UA).- Returns:
trueif tagging is required
-
requiresColorspace
public boolean requiresColorspace()
Tells whether the specification requires a device-independent color space or output intent for the colors used.- Returns:
trueif a color space definition is required
-
requiresMetadata
public boolean requiresMetadata()
Tells whether the specification requires XMP metadata (PDF/A and PDF/UA).- Returns:
trueif XMP metadata is required
-
requiresOutputInternet
public boolean requiresOutputInternet()
Tells whether the specification requires an output intent (PDF/A and PDF/UA). The method name is kept for compatibility.- Returns:
trueif an output intent is required
-
allowsExternalHyperlinking
public boolean allowsExternalHyperlinking()
Tells whether the specification allows links to external resources. Alwaystrue.- Returns:
true
-
requiresReliableUnicodeSemantics
public boolean requiresReliableUnicodeSemantics()
Tells whether the specification requires every glyph to map to Unicode text (PDF/A-1).- Returns:
trueif a Unicode mapping is required
-
getPdfVersionLabel
public java.lang.String getPdfVersionLabel()
Returns the PDF version of a version specification, without the extension level.- Returns:
- the version, for example "1.4", "1.7" (also for the 1.7 extension levels) or "2.0"; not meaningful for the PDF/A and PDF/UA constants
-
getPdfExtLevel
public int getPdfExtLevel()
Returns the Adobe extension level of a PDF 1.7 specification.- Returns:
- the extension level (for example 3 for
PDF_1_7_3), or 0 for other versions
-
getPdfaVersion
public int getPdfaVersion()
Returns the PDF/A part the specification includes.- Returns:
- 1, 2, 3 or 4, or 0 if it does not include PDF/A
-
getPdfuaVersion
public int getPdfuaVersion()
Returns the PDF/UA part of a PDF/UA constant (PDFUA_1orPDFUA_2). For a combined specification useisPdfua1()andisPdfua2().- Returns:
- 1 or 2, or 0 if this is not a PDF/UA constant
-
areCompatible
public static boolean areCompatible(PdfSpec pdf, PdfSpec pdfa1, PdfSpec pdfa2)
Checks whether a PDF version and up to two PDF/A or PDF/UA standards can be combined: PDF/A-4 needs PDF 1.7 or later, and PDF/UA-2 cannot be combined with PDF/A-1 to PDF/A-3. The other rules applied bycombine(PdfSpec)are not checked.- Parameters:
pdf- the PDF version, ornullpdfa1- the first standard, ornullpdfa2- the second standard, ornull- Returns:
falseif the combination is known to be invalid
-
getByLabel
public static PdfSpec getByLabel(java.lang.String label)
Finds a PDF version by its version number.- Parameters:
label- a version number with three characters, for example "1.4" or "2.0"- Returns:
- the matching PDF version constant, or
PDF_1_7if the label isnullor unknown
-
getInstance
public static PdfSpec getInstance(java.lang.String label)
Finds a specification constant by its name, as returned bytoString(), ignoring case: for example "1.4", "1.7ext3", "PDF/A-3b", "PDF/UA-1" or "Factur-X".- Parameters:
label- the name- Returns:
- the matching constant, or
PDF_1_7if the name isnullor unknown
-
getByID
public static PdfSpec getByID(int id)
Finds a PDF/A or PDF/UA constant by itsid.- Parameters:
id- the identifier, from 1 to 22- Returns:
- the matching constant, or
nullif there is none
-
listKeywords
public static java.lang.String listKeywords()
Lists the names of the supported specifications from PDF 1.4 on, for help texts: PDF versions are prefixed with "PDF" (for example 'PDF1.7'), the others are listed as they are (for example 'PDF/A-3b').- Returns:
- the names, each in single quotes, separated by spaces
-
-