closees #452
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
- #420
|
- #420
|
||||||
- #441
|
- #441
|
||||||
|
- #431 support reasoncodes
|
||||||
- Enhance Charges/Allowances with reasonCode. #432
|
- Enhance Charges/Allowances with reasonCode. #432
|
||||||
- Fix build warnings from editing and building. #415
|
- Fix build warnings from editing and building. #415
|
||||||
- ZUGFeRDVisualizer.toPDF(): generate PDF/A-3b. #400
|
- ZUGFeRDVisualizer.toPDF(): generate PDF/A-3b. #400
|
||||||
@@ -7,8 +8,9 @@
|
|||||||
and XML (zii.getFileAttachmentsXML)
|
and XML (zii.getFileAttachmentsXML)
|
||||||
- #436 and #370. (langfr)
|
- #436 and #370. (langfr)
|
||||||
- refactor(ZUGFeRDVisualizer): improve PDF visualization performance #438
|
- refactor(ZUGFeRDVisualizer): improve PDF visualization performance #438
|
||||||
|
- trying to default product on empty description
|
||||||
|
- #452
|
||||||
|
-
|
||||||
2.12.0
|
2.12.0
|
||||||
=======
|
=======
|
||||||
2024-07-20
|
2024-07-20
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ public class ZUGFeRDExporterFromA3 extends XRExporter implements IZUGFeRDExporte
|
|||||||
this.ignorePDFAErrors = true;
|
this.ignorePDFAErrors = true;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected PDFAConformanceLevel conformanceLevel = PDFAConformanceLevel.UNICODE;
|
protected PDFAConformanceLevel conformanceLevel = PDFAConformanceLevel.UNICODE;
|
||||||
protected ArrayList<FileAttachment> fileAttachments = new ArrayList<>();
|
protected ArrayList<FileAttachment> fileAttachments = new ArrayList<>();
|
||||||
|
|
||||||
@@ -223,20 +224,19 @@ public class ZUGFeRDExporterFromA3 extends XRExporter implements IZUGFeRDExporte
|
|||||||
* @return the filename of the file to be embedded
|
* @return the filename of the file to be embedded
|
||||||
*/
|
*/
|
||||||
public String getFilenameForVersion(int ver, Profile profile) {
|
public String getFilenameForVersion(int ver, Profile profile) {
|
||||||
|
if (profile.getName().equals("XRECHNUNG")) {
|
||||||
|
return "xrechnung.xml";
|
||||||
|
}
|
||||||
if (isFacturX) {
|
if (isFacturX) {
|
||||||
return "factur-x.xml";
|
return "factur-x.xml";
|
||||||
} else {
|
} else {
|
||||||
if (ver == 1) {
|
if (ver == 1) {
|
||||||
return "ZUGFeRD-invoice.xml";
|
return "ZUGFeRD-invoice.xml";
|
||||||
} else {
|
|
||||||
if (profile.getName().equals("XRECHNUNG")) {
|
|
||||||
return "xrechnung.xml";
|
|
||||||
} else {
|
} else {
|
||||||
return "zugferd-invoice.xml";
|
return "zugferd-invoice.xml";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -260,8 +260,7 @@ public class ZUGFeRDExporterFromA3 extends XRExporter implements IZUGFeRDExporte
|
|||||||
*
|
*
|
||||||
* @param XRechnungVersion the XRechnung version
|
* @param XRechnungVersion the XRechnung version
|
||||||
*/
|
*/
|
||||||
public void setXRechnungSpecificVersion(String XRechnungVersion)
|
public void setXRechnungSpecificVersion(String XRechnungVersion) {
|
||||||
{
|
|
||||||
this.XRechnungVersion = XRechnungVersion;
|
this.XRechnungVersion = XRechnungVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -538,8 +537,7 @@ public class ZUGFeRDExporterFromA3 extends XRExporter implements IZUGFeRDExporte
|
|||||||
|
|
||||||
// The XRechnung version may be settable from outside.
|
// The XRechnung version may be settable from outside.
|
||||||
if ((this.XRechnungVersion != null) && (this.profile != null) &&
|
if ((this.XRechnungVersion != null) && (this.profile != null) &&
|
||||||
this.profile.getName().equalsIgnoreCase(Profiles.getByName("XRECHNUNG").getName()))
|
this.profile.getName().equalsIgnoreCase(Profiles.getByName("XRECHNUNG").getName())) {
|
||||||
{
|
|
||||||
metaDataVersion = this.XRechnungVersion;
|
metaDataVersion = this.XRechnungVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -557,8 +555,7 @@ public class ZUGFeRDExporterFromA3 extends XRExporter implements IZUGFeRDExporte
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void removeCidSet(PDDocument doc)
|
private void removeCidSet(PDDocument doc)
|
||||||
throws IOException
|
throws IOException {
|
||||||
{
|
|
||||||
// https://github.com/ZUGFeRD/mustangproject/issues/249
|
// https://github.com/ZUGFeRD/mustangproject/issues/249
|
||||||
|
|
||||||
COSName cidSet = COSName.getPDFName("CIDSet");
|
COSName cidSet = COSName.getPDFName("CIDSet");
|
||||||
@@ -577,7 +574,7 @@ public class ZUGFeRDExporterFromA3 extends XRExporter implements IZUGFeRDExporte
|
|||||||
PDType0Font typedFont = (PDType0Font) pdFont;
|
PDType0Font typedFont = (PDType0Font) pdFont;
|
||||||
|
|
||||||
if (typedFont.getDescendantFont() instanceof PDCIDFontType2) {
|
if (typedFont.getDescendantFont() instanceof PDCIDFontType2) {
|
||||||
@SuppressWarnings ("unused")
|
@SuppressWarnings("unused")
|
||||||
PDCIDFontType2 f = (PDCIDFontType2) typedFont.getDescendantFont();
|
PDCIDFontType2 f = (PDCIDFontType2) typedFont.getDescendantFont();
|
||||||
PDFontDescriptor fontDescriptor = pdFont.getFontDescriptor();
|
PDFontDescriptor fontDescriptor = pdFont.getFontDescriptor();
|
||||||
|
|
||||||
@@ -651,11 +648,9 @@ public class ZUGFeRDExporterFromA3 extends XRExporter implements IZUGFeRDExporte
|
|||||||
// ZUGFeRD 2.1.1 Technical Supplement | Part A | 2.2.2. Data Relationship
|
// ZUGFeRD 2.1.1 Technical Supplement | Part A | 2.2.2. Data Relationship
|
||||||
// See documentation ZUGFeRD211_EN/Documentation/ZUGFeRD-2.1.1 - Specification_TA_Part-A.pdf
|
// See documentation ZUGFeRD211_EN/Documentation/ZUGFeRD-2.1.1 - Specification_TA_Part-A.pdf
|
||||||
// https://www.ferd-net.de/standards/zugferd-2.1.1/index.html
|
// https://www.ferd-net.de/standards/zugferd-2.1.1/index.html
|
||||||
if ((this.profile != null) && (ZFVersion >= 2))
|
if ((this.profile != null) && (ZFVersion >= 2)) {
|
||||||
{
|
|
||||||
if (this.profile.getName().equalsIgnoreCase(Profiles.getByName("MINIMUM").getName()) ||
|
if (this.profile.getName().equalsIgnoreCase(Profiles.getByName("MINIMUM").getName()) ||
|
||||||
this.profile.getName().equalsIgnoreCase(Profiles.getByName("BASICWL").getName()))
|
this.profile.getName().equalsIgnoreCase(Profiles.getByName("BASICWL").getName())) {
|
||||||
{
|
|
||||||
relationship = "Data";
|
relationship = "Data";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -674,12 +669,12 @@ public class ZUGFeRDExporterFromA3 extends XRExporter implements IZUGFeRDExporte
|
|||||||
/**
|
/**
|
||||||
* Reads the XMPMetadata from the PDDocument, if it exists.
|
* Reads the XMPMetadata from the PDDocument, if it exists.
|
||||||
* Otherwise creates XMPMetadata.
|
* Otherwise creates XMPMetadata.
|
||||||
|
*
|
||||||
* @return the finished XMPMetadata object
|
* @return the finished XMPMetadata object
|
||||||
* @throws IOException when e.g. XmpParsingException
|
* @throws IOException when e.g. XmpParsingException
|
||||||
*/
|
*/
|
||||||
protected XMPMetadata getXmpMetadata()
|
protected XMPMetadata getXmpMetadata()
|
||||||
throws IOException
|
throws IOException {
|
||||||
{
|
|
||||||
PDMetadata meta = doc.getDocumentCatalog().getMetadata();
|
PDMetadata meta = doc.getDocumentCatalog().getMetadata();
|
||||||
if ((meta != null) && (meta.getLength() > 0)) {
|
if ((meta != null) && (meta.getLength() > 0)) {
|
||||||
try {
|
try {
|
||||||
@@ -701,6 +696,7 @@ public class ZUGFeRDExporterFromA3 extends XRExporter implements IZUGFeRDExporte
|
|||||||
/**
|
/**
|
||||||
* Sets the producer if the overwrite flag is set or the producer is not already set.
|
* Sets the producer if the overwrite flag is set or the producer is not already set.
|
||||||
* Sets the PDFVersion to 1.4 if the field is empty.
|
* Sets the PDFVersion to 1.4 if the field is empty.
|
||||||
|
*
|
||||||
* @param xmp the metadata as XML
|
* @param xmp the metadata as XML
|
||||||
*/
|
*/
|
||||||
protected void writeAdobePDFSchema(XMPMetadata xmp) {
|
protected void writeAdobePDFSchema(XMPMetadata xmp) {
|
||||||
@@ -823,11 +819,11 @@ public class ZUGFeRDExporterFromA3 extends XRExporter implements IZUGFeRDExporte
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds an OutputIntent and the sRGB color profile if no OutputIntent exist
|
* Adds an OutputIntent and the sRGB color profile if no OutputIntent exist
|
||||||
|
*
|
||||||
* @throws IOException if the ICC file cannot be read or attached to doc
|
* @throws IOException if the ICC file cannot be read or attached to doc
|
||||||
*/
|
*/
|
||||||
protected void addSRGBOutputIntend()
|
protected void addSRGBOutputIntend()
|
||||||
throws IOException
|
throws IOException {
|
||||||
{
|
|
||||||
if (!doc.getDocumentCatalog().getOutputIntents().isEmpty()) {
|
if (!doc.getDocumentCatalog().getOutputIntents().isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -892,12 +888,12 @@ public class ZUGFeRDExporterFromA3 extends XRExporter implements IZUGFeRDExporte
|
|||||||
|
|
||||||
public ZUGFeRDExporterFromA3 setZUGFeRDVersion(EStandard est, int version) {
|
public ZUGFeRDExporterFromA3 setZUGFeRDVersion(EStandard est, int version) {
|
||||||
this.ZFVersion = version;
|
this.ZFVersion = version;
|
||||||
if ((version<1) || (version>2)) {
|
if ((version < 1) || (version > 2)) {
|
||||||
throw new IllegalArgumentException("Version not supported");
|
throw new IllegalArgumentException("Version not supported");
|
||||||
}
|
}
|
||||||
int generation=version;
|
int generation = version;
|
||||||
if ((est==EStandard.facturx)&&(version==1)) {
|
if ((est == EStandard.facturx) && (version == 1)) {
|
||||||
generation=2;
|
generation = 2;
|
||||||
}
|
}
|
||||||
if (generation == 1) {
|
if (generation == 1) {
|
||||||
ZUGFeRD1PullProvider z1p = new ZUGFeRD1PullProvider();
|
ZUGFeRD1PullProvider z1p = new ZUGFeRD1PullProvider();
|
||||||
|
|||||||
Reference in New Issue
Block a user