diff --git a/src/OrderDocumentPdfBuilderAbstract.php b/src/OrderDocumentPdfBuilderAbstract.php index 1dcc5c1..7d07e2e 100644 --- a/src/OrderDocumentPdfBuilderAbstract.php +++ b/src/OrderDocumentPdfBuilderAbstract.php @@ -14,7 +14,6 @@ use horstoeko\orderx\codelists\OrderDocumentTypes; use horstoeko\orderx\OrderPackageVersion; use horstoeko\orderx\OrderPdfWriter; -use horstoeko\stringmanagement\PathUtils; use setasign\Fpdi\PdfParser\StreamReader as PdfStreamReader; /** @@ -178,7 +177,7 @@ private function updatePdfMetadata(): void $pdfMetadataInfos = $this->preparePdfMetadata(); $this->pdfWriter->setPdfMetadataInfos($pdfMetadataInfos); - $xmp = simplexml_load_file(PathUtils::combinePathWithFile(OrderSettings::getAssetDirectory(), 'orderx_extension_schema.xmp')); + $xmp = simplexml_load_file(OrderSettings::getFullXmpMetaDataFilename()); $descNodes = $xmp->xpath('rdf:Description'); $descNode = $descNodes[0]; diff --git a/src/OrderSettings.php b/src/OrderSettings.php index feccbe7..8eab18a 100644 --- a/src/OrderSettings.php +++ b/src/OrderSettings.php @@ -64,6 +64,13 @@ class OrderSettings */ protected static $iccProfileFilename = "sRGB_v4_ICC.icc"; + /** + * The filename of the XMP meta data + * + * @var string + */ + protected static $xmpMetaDataFilename = "orderx_extension_schema.xmp"; + /** * Get the number of decimals to use for amount values * @@ -71,7 +78,7 @@ class OrderSettings */ public static function getAmountDecimals(): int { - return self::$amountDecimals; + return static::$amountDecimals; } /** @@ -82,7 +89,7 @@ public static function getAmountDecimals(): int */ public static function setAmountDecimals(int $amountDecimals): void { - self::$amountDecimals = $amountDecimals; + static::$amountDecimals = $amountDecimals; } /** @@ -92,7 +99,7 @@ public static function setAmountDecimals(int $amountDecimals): void */ public static function getQuantityDecimals(): int { - return self::$quantityDecimals; + return static::$quantityDecimals; } /** @@ -103,7 +110,7 @@ public static function getQuantityDecimals(): int */ public static function setQuantityDecimals(int $quantityDecimals): void { - self::$quantityDecimals = $quantityDecimals; + static::$quantityDecimals = $quantityDecimals; } /** @@ -113,7 +120,7 @@ public static function setQuantityDecimals(int $quantityDecimals): void */ public static function getPercentDecimals(): int { - return self::$percentDecimals; + return static::$percentDecimals; } /** @@ -124,7 +131,7 @@ public static function getPercentDecimals(): int */ public static function setPercentDecimals(int $percentDecimals): void { - self::$percentDecimals = $percentDecimals; + static::$percentDecimals = $percentDecimals; } /** @@ -134,7 +141,7 @@ public static function setPercentDecimals(int $percentDecimals): void */ public static function getDecimalSeparator(): string { - return self::$decimalSeparator; + return static::$decimalSeparator; } /** @@ -145,7 +152,7 @@ public static function getDecimalSeparator(): string */ public static function setDecimalSeparator(string $decimalSeparator): void { - self::$decimalSeparator = $decimalSeparator; + static::$decimalSeparator = $decimalSeparator; } /** @@ -155,7 +162,7 @@ public static function setDecimalSeparator(string $decimalSeparator): void */ public static function getThousandsSeparator(): string { - return self::$thousandsSeparator; + return static::$thousandsSeparator; } /** @@ -166,7 +173,7 @@ public static function getThousandsSeparator(): string */ public static function setThousandsSeparator(string $thousandsSeparator): void { - self::$thousandsSeparator = $thousandsSeparator; + static::$thousandsSeparator = $thousandsSeparator; } /** @@ -176,7 +183,7 @@ public static function setThousandsSeparator(string $thousandsSeparator): void */ public static function getIccProfileFilename(): string { - return self::$iccProfileFilename; + return static::$iccProfileFilename; } /** @@ -187,7 +194,28 @@ public static function getIccProfileFilename(): string */ public static function setIccProfileFilename(string $iccProfileFilename): void { - self::$iccProfileFilename = $iccProfileFilename; + static::$iccProfileFilename = $iccProfileFilename; + } + + /** + * Get the filename for the XMP meta data + * + * @return string + */ + public static function getXmpMetaDataFilename(): string + { + return static::$xmpMetaDataFilename; + } + + /** + * Set the filename for the XMP meta data + * + * @param string $xmpMetaDataFilename + * @return void + */ + public static function setXmpMetaDataFilename(string $xmpMetaDataFilename): void + { + static::$xmpMetaDataFilename = $xmpMetaDataFilename; } /** @@ -207,7 +235,7 @@ public static function getRootDirectory(): string */ public static function getSourceDirectory(): string { - return PathUtils::combineAllPaths(self::getRootDirectory(), "src"); + return PathUtils::combineAllPaths(static::getRootDirectory(), "src"); } /** @@ -217,7 +245,7 @@ public static function getSourceDirectory(): string */ public static function getAssetDirectory(): string { - return PathUtils::combineAllPaths(self::getSourceDirectory(), "assets"); + return PathUtils::combineAllPaths(static::getSourceDirectory(), "assets"); } /** @@ -227,7 +255,7 @@ public static function getAssetDirectory(): string */ public static function getYamlDirectory(): string { - return PathUtils::combineAllPaths(self::getSourceDirectory(), "yaml"); + return PathUtils::combineAllPaths(static::getSourceDirectory(), "yaml"); } /** @@ -237,7 +265,7 @@ public static function getYamlDirectory(): string */ public static function getValidationDirectory(): string { - return PathUtils::combineAllPaths(self::getSourceDirectory(), "validation"); + return PathUtils::combineAllPaths(static::getSourceDirectory(), "validation"); } /** @@ -247,6 +275,16 @@ public static function getValidationDirectory(): string */ public static function getFullIccProfileFilename(): string { - return PathUtils::combinePathWithFile(self::getAssetDirectory(), self::$iccProfileFilename); + return PathUtils::combinePathWithFile(static::getAssetDirectory(), static::$iccProfileFilename); + } + + /** + * Get the full filename containg the XNP information to user + * + * @return string + */ + public static function getFullXmpMetaDataFilename(): string + { + return PathUtils::combinePathWithFile(static::getAssetDirectory(), static::$xmpMetaDataFilename); } }