Package org.mustangproject.ZUGFeRD
Class DXExporterFromA1
- java.lang.Object
-
- org.mustangproject.ZUGFeRD.XRExporter
-
- org.mustangproject.ZUGFeRD.ZUGFeRDExporterFromA3
-
- org.mustangproject.ZUGFeRD.DXExporterFromA3
-
- org.mustangproject.ZUGFeRD.DXExporterFromA1
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,IExporter,IZUGFeRDExporter
public class DXExporterFromA1 extends DXExporterFromA3
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanignorePDFAErrors-
Fields inherited from class org.mustangproject.ZUGFeRD.DXExporterFromA3
author, conformanceLevel, creator, creatorTool, despatchAdviceDocumentType, fileAttachments, metadata, overwrite, producer, subject, title
-
Fields inherited from class org.mustangproject.ZUGFeRD.ZUGFeRDExporterFromA3
DefaultZUGFeRDVersion, doc, xmp, XRechnungVersion, ZFVersion
-
-
Constructor Summary
Constructors Constructor Description DXExporterFromA1()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DXExporterFromA1convertOnly()DXExporterFromA1disableAutoClose(boolean disableAutoClose)booleanensurePDFIsValid(jakarta.activation.DataSource dataSource)java.lang.StringgetNamespaceForVersion(int ver)internal helper function: get namespace for order-xjava.lang.StringgetPrefixForVersion(int ver)internal helper: returns the namespace prefix for the given order-x version numberDXExporterFromA1ignorePDFAErrors()DXExporterFromA1load(byte[] pdfBinary)Makes A PDF/A3a-compliant document from a PDF-A1 compliant document (on the metadata level, this will not e.g. convert graphics to JPG-2000)DXExporterFromA1load(java.io.InputStream pdfSource)Makes A PDF/A3a-compliant document from a PDF-A1 compliant document (on the metadata level, this will not e.g. convert graphics to JPG-2000)DXExporterFromA1load(java.lang.String pdfFilename)Makes A PDF/A3a-compliant document from a PDF-A1 compliant document (on the metadata level, this will not e.g. convert graphics to JPG-2000)DXExporterFromA1setConformanceLevel(PDFAConformanceLevel newLevel)All files are PDF/A-3, setConformance refers to the level conformance.DXExporterFromA1setCreator(java.lang.String creator)DXExporterFromA1setProducer(java.lang.String producer)DXExporterFromA1setProfile(java.lang.String profileName)DXExporterFromA1setProfile(Profile p)DXExporterFromA1setXML(byte[] zugferdData)Sets the ZUGFeRD XML data to be attached as a single byte array.DXExporterFromA1setZUGFeRDVersion(int version)-
Methods inherited from class org.mustangproject.ZUGFeRD.DXExporterFromA3
addAdditionalFile, addSRGBOutputIntend, addStructureTreeRoot, addXMP, attachFile, attachFile, close, export, export, getAdobePDFSchema, getDublinCoreSchema, getPDFAIdentificationSchema, getProvider, getXmpBasicSchema, getXmpMetadata, isAutoCloseDisabled, PDFAttachGenericFile, PDFAttachGenericFile, prepare, serializeXmpMetadata, setAttachZUGFeRDHeaders, setCreatorTool, setDocumentType, setMarked, setTransaction, setXMLProvider, writeAdobePDFSchema, writeDocumentInformation, writeDublinCoreSchema, writePDFAIdentificationSchema, writeXMLBasicSchema
-
Methods inherited from class org.mustangproject.ZUGFeRD.ZUGFeRDExporterFromA3
disableFacturX, getFilenameForVersion, prepareDocument, setFacturX, setXRechnungSpecificVersion, setZUGFeRDVersion
-
-
-
-
Method Detail
-
ignorePDFAErrors
public DXExporterFromA1 ignorePDFAErrors()
- Overrides:
ignorePDFAErrorsin classZUGFeRDExporterFromA3
-
getNamespaceForVersion
public java.lang.String getNamespaceForVersion(int ver)
internal helper function: get namespace for order-x- Specified by:
getNamespaceForVersionin interfaceIZUGFeRDExporter- Overrides:
getNamespaceForVersionin classZUGFeRDExporterFromA3- Parameters:
ver- the delivery-x version- Returns:
- the URN of the namespace
-
getPrefixForVersion
public java.lang.String getPrefixForVersion(int ver)
internal helper: returns the namespace prefix for the given order-x version number- Specified by:
getPrefixForVersionin interfaceIZUGFeRDExporter- Overrides:
getPrefixForVersionin classZUGFeRDExporterFromA3- Parameters:
ver- the ox version- Returns:
- the namespace prefix as string, without colon
-
setProfile
public DXExporterFromA1 setProfile(Profile p)
- Specified by:
setProfilein interfaceIZUGFeRDExporter- Overrides:
setProfilein classDXExporterFromA3
-
setProfile
public DXExporterFromA1 setProfile(java.lang.String profileName)
- Overrides:
setProfilein classDXExporterFromA3
-
ensurePDFIsValid
public boolean ensurePDFIsValid(jakarta.activation.DataSource dataSource) throws java.io.IOException- Specified by:
ensurePDFIsValidin interfaceIZUGFeRDExporter- Overrides:
ensurePDFIsValidin classDXExporterFromA3- Throws:
java.io.IOException
-
load
public DXExporterFromA1 load(java.lang.String pdfFilename) throws java.io.IOException
Description copied from class:DXExporterFromA3Makes A PDF/A3a-compliant document from a PDF-A1 compliant document (on the metadata level, this will not e.g. convert graphics to JPG-2000)- Specified by:
loadin interfaceIZUGFeRDExporter- Overrides:
loadin classDXExporterFromA3- Parameters:
pdfFilename- filename of an PDF/A1 compliant document- Returns:
- the generated exporter
- Throws:
java.io.IOException- if anything is wrong with filename
-
load
public DXExporterFromA1 load(byte[] pdfBinary) throws java.io.IOException
Description copied from class:DXExporterFromA3Makes A PDF/A3a-compliant document from a PDF-A1 compliant document (on the metadata level, this will not e.g. convert graphics to JPG-2000)- Specified by:
loadin interfaceIZUGFeRDExporter- Overrides:
loadin classDXExporterFromA3- Parameters:
pdfBinary- binary of a PDF/A1 compliant document- Returns:
- the generated exporter
- Throws:
java.io.IOException- (should not happen at all)
-
load
public DXExporterFromA1 load(java.io.InputStream pdfSource) throws java.io.IOException
Description copied from class:DXExporterFromA3Makes A PDF/A3a-compliant document from a PDF-A1 compliant document (on the metadata level, this will not e.g. convert graphics to JPG-2000)- Specified by:
loadin interfaceIZUGFeRDExporter- Overrides:
loadin classDXExporterFromA3- Parameters:
pdfSource- source to read a PDF/A1 compliant document from- Returns:
- the generated ZUGFeRDExporter
- Throws:
java.io.IOException- if anything is wrong with inputstream
-
setCreator
public DXExporterFromA1 setCreator(java.lang.String creator)
- Specified by:
setCreatorin interfaceIZUGFeRDExporter- Overrides:
setCreatorin classDXExporterFromA3
-
setConformanceLevel
public DXExporterFromA1 setConformanceLevel(PDFAConformanceLevel newLevel)
Description copied from class:DXExporterFromA3All files are PDF/A-3, setConformance refers to the level conformance.PDF/A-3 has three coformance levels, called "A", "U" and "B".
PDF/A-3-B where B means only visually preservable, U -standard for Mustang- means visually and unicode preservable and A means full compliance, i.e. visually, unicode and structurally preservable and tagged PDF, i.e. useful metainformation for blind people.
Feel free to pass "A" as new level if you know what you are doing :-)
- Specified by:
setConformanceLevelin interfaceIZUGFeRDExporter- Overrides:
setConformanceLevelin classDXExporterFromA3
-
setProducer
public DXExporterFromA1 setProducer(java.lang.String producer)
- Specified by:
setProducerin interfaceIZUGFeRDExporter- Overrides:
setProducerin classDXExporterFromA3
-
setZUGFeRDVersion
public DXExporterFromA1 setZUGFeRDVersion(int version)
- Specified by:
setZUGFeRDVersionin interfaceIZUGFeRDExporter- Overrides:
setZUGFeRDVersionin classDXExporterFromA3
-
setXML
public DXExporterFromA1 setXML(byte[] zugferdData) throws java.io.IOException
Description copied from class:DXExporterFromA3Sets the ZUGFeRD XML data to be attached as a single byte array. This is useful for use-cases where the XML has already been produced by some external API or component.- Specified by:
setXMLin interfaceIZUGFeRDExporter- Overrides:
setXMLin classDXExporterFromA3- Parameters:
zugferdData- XML data to be set as a byte array (XML file in raw form).- Throws:
java.io.IOException- (should not happen)
-
disableAutoClose
public DXExporterFromA1 disableAutoClose(boolean disableAutoClose)
- Specified by:
disableAutoClosein interfaceIZUGFeRDExporter- Overrides:
disableAutoClosein classDXExporterFromA3- Parameters:
disableAutoClose- prevent PDF file from being closed after adding ZF
-
convertOnly
public DXExporterFromA1 convertOnly()
-
-