diff options
author | Thomas Deutschmann <whissi@gentoo.org> | 2021-03-30 10:59:39 +0200 |
---|---|---|
committer | Thomas Deutschmann <whissi@gentoo.org> | 2021-04-01 00:04:14 +0200 |
commit | 5ff1d6955496b3cf9a35042c9ac35db43bc336b1 (patch) | |
tree | 6d470f7eb448f59f53e8df1010aec9dad8ce1f72 /lib | |
parent | Import Ghostscript 9.53.1 (diff) | |
download | ghostscript-gpl-patches-5ff1d6955496b3cf9a35042c9ac35db43bc336b1.tar.gz ghostscript-gpl-patches-5ff1d6955496b3cf9a35042c9ac35db43bc336b1.tar.bz2 ghostscript-gpl-patches-5ff1d6955496b3cf9a35042c9ac35db43bc336b1.zip |
Import Ghostscript 9.54ghostscript-9.54
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'lib')
59 files changed, 619 insertions, 83 deletions
diff --git a/lib/FCOfontmap-PCLPS3 b/lib/FCOfontmap-PCLPS3 index 2a01896f..eaca971b 100644 --- a/lib/FCOfontmap-PCLPS3 +++ b/lib/FCOfontmap-PCLPS3 @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/FCOfontmap-PS3 b/lib/FCOfontmap-PS3 index 17e597df..62f731a5 100644 --- a/lib/FCOfontmap-PS3 +++ b/lib/FCOfontmap-PS3 @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/Fontmap.ATB b/lib/Fontmap.ATB index 9f7f92c0..36180009 100644 --- a/lib/Fontmap.ATB +++ b/lib/Fontmap.ATB @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/Fontmap.ATM b/lib/Fontmap.ATM index 5080f767..1cfa0dfe 100644 --- a/lib/Fontmap.ATM +++ b/lib/Fontmap.ATM @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/Fontmap.OS2 b/lib/Fontmap.OS2 index 404deb7a..dcc687bc 100644 --- a/lib/Fontmap.OS2 +++ b/lib/Fontmap.OS2 @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/Fontmap.SGI b/lib/Fontmap.SGI index a6087f06..6d8376e7 100644 --- a/lib/Fontmap.SGI +++ b/lib/Fontmap.SGI @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/Fontmap.Sol b/lib/Fontmap.Sol index add5a3cc..d66c3b2a 100644 --- a/lib/Fontmap.Sol +++ b/lib/Fontmap.Sol @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/Fontmap.Ult b/lib/Fontmap.Ult index 45329670..869f1f5b 100644 --- a/lib/Fontmap.Ult +++ b/lib/Fontmap.Ult @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/Fontmap.VMS b/lib/Fontmap.VMS index 1707191c..baaf6f1f 100644 --- a/lib/Fontmap.VMS +++ b/lib/Fontmap.VMS @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/align.ps b/lib/align.ps index 8f2ebf5a..e1f562b3 100644 --- a/lib/align.ps +++ b/lib/align.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/caption.ps b/lib/caption.ps index 1ec719a7..7e345ba5 100644 --- a/lib/caption.ps +++ b/lib/caption.ps @@ -1,5 +1,5 @@ %! -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/cid2code.ps b/lib/cid2code.ps index 98423fb7..45044cdf 100644 --- a/lib/cid2code.ps +++ b/lib/cid2code.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/docie.ps b/lib/docie.ps index 82a16bb0..1d1ad9a1 100644 --- a/lib/docie.ps +++ b/lib/docie.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/font2pcl.ps b/lib/font2pcl.ps index 2ce2c3d7..7ab9330d 100644 --- a/lib/font2pcl.ps +++ b/lib/font2pcl.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/gs_ce_e.ps b/lib/gs_ce_e.ps index 5db08a11..150c55b2 100644 --- a/lib/gs_ce_e.ps +++ b/lib/gs_ce_e.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/gs_css_e.ps b/lib/gs_css_e.ps new file mode 100644 index 00000000..c4323bc5 --- /dev/null +++ b/lib/gs_css_e.ps @@ -0,0 +1,117 @@ +% Copyright (C) 2001-2021 Artifex Software, Inc. +% All Rights Reserved. +% +% This software is provided AS-IS with no warranty, either express or +% implied. +% +% This software is distributed under license and may not be copied, +% modified or distributed except as expressly authorized under the terms +% of the license contained in the file LICENSE in this distribution. +% +% Refer to licensing information at http://www.artifex.com or contact +% Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134, San Rafael, +% CA 94903, U.S.A., +1(415)492-9861, for further information. +% + +% Define the CFF StandardStrings that represent characters. +% This is a pseudo-encoding. +/currentglobal where + { pop currentglobal { setglobal } //true setglobal } + { { } } +ifelse +/CFFStandardStrings mark + +% 0 + /.notdef /space /exclam /quotedbl /numbersign + /dollar /percent /ampersand /quoteright /parenleft + /parenright /asterisk /plus /comma /hyphen + /period /slash /zero /one /two + /three /four /five /six /seven + /eight /nine /colon /semicolon /less + /equal /greater /question /at /A + /B /C /D /E /F + /G /H /I /J /K + /L /M /N /O /P +% 50 + /Q /R /S /T /U + /V /W /X /Y /Z + /bracketleft /backslash /bracketright /asciicircum /underscore + /quoteleft /a /b /c /d + /e /f /g /h /i + /j /k /l /m /n + /o /p /q /r /s + /t /u /v /w /x + /y /z /braceleft /bar /braceright + /asciitilde /exclamdown /cent /sterling /fraction +% 100 + /yen /florin /section /currency /quotesingle + /quotedblleft /guillemotleft /guilsinglleft /guilsinglright /fi + /fl /endash /dagger /daggerdbl /periodcentered + /paragraph /bullet /quotesinglbase /quotedblbase /quotedblright + /guillemotright /ellipsis /perthousand /questiondown /grave + /acute /circumflex /tilde /macron /breve + /dotaccent /dieresis /ring /cedilla /hungarumlaut + /ogonek /caron /emdash /AE /ordfeminine + /Lslash /Oslash /OE /ordmasculine /ae + /dotlessi /lslash /oslash /oe /germandbls +% 150 + /onesuperior /logicalnot /mu /trademark /Eth + /onehalf /plusminus /Thorn /onequarter /divide + /brokenbar /degree /thorn /threequarters /twosuperior + /registered /minus /eth /multiply /threesuperior + /copyright /Aacute /Acircumflex /Adieresis /Agrave + /Aring /Atilde /Ccedilla /Eacute /Ecircumflex + /Edieresis /Egrave /Iacute /Icircumflex /Idieresis + /Igrave /Ntilde /Oacute /Ocircumflex /Odieresis + /Ograve /Otilde /Scaron /Uacute /Ucircumflex + /Udieresis /Ugrave /Yacute /Ydieresis /Zcaron +% 200 + /aacute /acircumflex /adieresis /agrave /aring + /atilde /ccedilla /eacute /ecircumflex /edieresis + /egrave /iacute /icircumflex /idieresis /igrave + /ntilde /oacute /ocircumflex /odieresis /ograve + /otilde /scaron /uacute /ucircumflex /udieresis + /ugrave /yacute /ydieresis /zcaron /exclamsmall + /Hungarumlautsmall /dollaroldstyle /dollarsuperior /ampersandsmall /Acutesmall + /parenleftsuperior /parenrightsuperior /twodotenleader /onedotenleader /zerooldstyle + /oneoldstyle /twooldstyle /threeoldstyle /fouroldstyle /fiveoldstyle + /sixoldstyle /sevenoldstyle /eightoldstyle /nineoldstyle /commasuperior +% 250 + /threequartersemdash /periodsuperior /questionsmall /asuperior /bsuperior + /centsuperior /dsuperior /esuperior /isuperior /lsuperior + /msuperior /nsuperior /osuperior /rsuperior /ssuperior + /tsuperior /ff /ffi /ffl /parenleftinferior + /parenrightinferior /Circumflexsmall /hyphensuperior /Gravesmall /Asmall + /Bsmall /Csmall /Dsmall /Esmall /Fsmall + /Gsmall /Hsmall /Ismall /Jsmall /Ksmall + /Lsmall /Msmall /Nsmall /Osmall /Psmall + /Qsmall /Rsmall /Ssmall /Tsmall /Usmall + /Vsmall /Wsmall /Xsmall /Ysmall /Zsmall +% 300 + /colonmonetary /onefitted /rupiah /Tildesmall /exclamdownsmall + /centoldstyle /Lslashsmall /Scaronsmall /Zcaronsmall /Dieresissmall + /Brevesmall /Caronsmall /Dotaccentsmall /Macronsmall /figuredash + /hypheninferior /Ogoneksmall /Ringsmall /Cedillasmall /questiondownsmall + /oneeighth /threeeighths /fiveeighths /seveneighths /onethird + /twothirds /zerosuperior /foursuperior /fivesuperior /sixsuperior + /sevensuperior /eightsuperior /ninesuperior /zeroinferior /oneinferior + /twoinferior /threeinferior /fourinferior /fiveinferior /sixinferior + /seveninferior /eightinferior /nineinferior /centinferior /dollarinferior + /periodinferior /commainferior /Agravesmall /Aacutesmall /Acircumflexsmall +% 350 + /Atildesmall /Adieresissmall /Aringsmall /AEsmall /Ccedillasmall + /Egravesmall /Eacutesmall /Ecircumflexsmall /Edieresissmall /Igravesmall + /Iacutesmall /Icircumflexsmall /Idieresissmall /Ethsmall /Ntildesmall + /Ogravesmall /Oacutesmall /Ocircumflexsmall /Otildesmall /Odieresissmall + /OEsmall /Oslashsmall /Ugravesmall /Uacutesmall /Ucircumflexsmall + /Udieresissmall /Yacutesmall /Thornsmall /Ydieresissmall +% 379 + /001.000 /001.001 /001.002 /001.003 + /Black /Bold /Book /Light /Medium + /Regular /Roman /Semibold +%391 = end + +counttomark packedarray exch pop +10 1 index .registerencoding +.defineencoding +exec diff --git a/lib/gs_il2_e.ps b/lib/gs_il2_e.ps index 7ef56d45..e9ee3075 100644 --- a/lib/gs_il2_e.ps +++ b/lib/gs_il2_e.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/gs_kanji.ps b/lib/gs_kanji.ps index 862f5ff3..f2de7816 100644 --- a/lib/gs_kanji.ps +++ b/lib/gs_kanji.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/gs_ksb_e.ps b/lib/gs_ksb_e.ps index 4d228765..2d2960c7 100644 --- a/lib/gs_ksb_e.ps +++ b/lib/gs_ksb_e.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/gs_lgo_e.ps b/lib/gs_lgo_e.ps index dd04ff66..1f949ab9 100644 --- a/lib/gs_lgo_e.ps +++ b/lib/gs_lgo_e.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/gs_lgx_e.ps b/lib/gs_lgx_e.ps index 0c12e2d8..a2f62160 100644 --- a/lib/gs_lgx_e.ps +++ b/lib/gs_lgx_e.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/gs_wl1_e.ps b/lib/gs_wl1_e.ps index 72185fee..10a8f3ca 100644 --- a/lib/gs_wl1_e.ps +++ b/lib/gs_wl1_e.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/gs_wl2_e.ps b/lib/gs_wl2_e.ps index 6b55c557..f7fc8cc1 100644 --- a/lib/gs_wl2_e.ps +++ b/lib/gs_wl2_e.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/gs_wl5_e.ps b/lib/gs_wl5_e.ps index 4f259792..f7549b49 100644 --- a/lib/gs_wl5_e.ps +++ b/lib/gs_wl5_e.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/gslp.ps b/lib/gslp.ps index 9e2c21bf..173d52c2 100644 --- a/lib/gslp.ps +++ b/lib/gslp.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/gsnup.ps b/lib/gsnup.ps index ea01d874..61fd57a6 100644 --- a/lib/gsnup.ps +++ b/lib/gsnup.ps @@ -1,5 +1,5 @@ %! -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/image-qa.ps b/lib/image-qa.ps index 307a951d..4780c14e 100644 --- a/lib/image-qa.ps +++ b/lib/image-qa.ps @@ -1,5 +1,5 @@ %!PS -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/jispaper.ps b/lib/jispaper.ps index d1e33e6a..6b59f70b 100644 --- a/lib/jispaper.ps +++ b/lib/jispaper.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/lines.ps b/lib/lines.ps index 287b6bdb..a721009a 100644 --- a/lib/lines.ps +++ b/lib/lines.ps @@ -1,5 +1,5 @@ %! -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/mkcidfm.ps b/lib/mkcidfm.ps index 7dd92fe3..6e017161 100644 --- a/lib/mkcidfm.ps +++ b/lib/mkcidfm.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/pdf2dsc.ps b/lib/pdf2dsc.ps index 88bc1536..8e65d9e0 100644 --- a/lib/pdf2dsc.ps +++ b/lib/pdf2dsc.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/pdf_info.ps b/lib/pdf_info.ps index 0b4654ab..35951e9a 100644 --- a/lib/pdf_info.ps +++ b/lib/pdf_info.ps @@ -1,5 +1,5 @@ %!PS -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or @@ -69,6 +69,81 @@ cleartomark % discard the dict from --where-- % ---- No more executable code on the top level after this line ----- % ---- except 2 lines at the very end ----- +% Write a character to the standard output. +/putchar [ % int -> - + (%stdout) (w) file + /exch cvx /write cvx +] cvx bind def + +% Write U+xxxx to the standard output as UTF-8. +/put-ucode { % int -> - + dup 16#80 ge { + dup 16#800 ge { + dup 16#10000 ge { + dup -18 bitshift 16#f0 or putchar + dup -12 bitshift 16#3f and 16#80 or putchar + } { + dup -12 bitshift 16#e0 or putchar + } ifelse + dup -6 bitshift 16#3f and 16#80 or putchar + } { + dup -6 bitshift 16#C0 or putchar + } ifelse + 16#3f and 16#80 or + } if + putchar +} bind def + +% PDFDocEncoding to U+xxxx decoding table. +/doc-to-ucode [ + 0 1 23 {} for + 16#2d8 16#2c7 16#2c6 16#2d9 16#2dd 16#2db 16#2da 16#2dc + 32 1 127 {} for + 16#2022 16#2020 16#2021 16#2026 16#2014 16#2013 16#192 + 16#2044 16#2039 16#203a 16#2212 16#2030 16#201e 16#201c + 16#201d 16#2018 16#2019 16#201a 16#2122 16#fb01 16#fb02 + 16#141 16#152 16#160 16#178 16#17d 16#131 16#142 16#153 + 16#161 16#17e 0 16#20ac + 161 1 255 {} for +] readonly def + +% Convert a doc string from PDFDocEncoding or UTF-16BE to UTF-8 +% and write it to standard output. +/write-doc-string { % (string) -> - + 1024 string cvs <feff> anchorsearch { + pop + 0 exch % hi16 (str) + 0 2 2 index length 2 sub { + 2 copy 2 copy % hi16 (str) i (str) i (str) i + get 256 mul 3 1 roll % hi16 (str) i hi*256 (str) i + 1 add get add % hi16 (str) i 256*hi+lo + dup 16#fc00 and dup % hi16 (str) i 256*hi+lo tag tag + 16#d800 eq { % High surrogate + pop + 16#3ff and + 10 bitshift + 16#10000 add % hi16 (str) i hi16' + 4 1 roll % hi16' hi16 (str) i + pop exch pop % hi16' (str) + } { + 16#dc00 eq { % Low surrogate + 16#3ff and % hi16 (str) i (256*hi+lo)&0x3ff + 4 -1 roll add % (str) i (256*hi+lo)&0x3ff+hi16 + put-ucode % (str) i + pop 0 exch % 0 (str) + } { % BMP plane + put-ucode % hi16 (str) i + pop % hi16 (str) + } ifelse + } ifelse + } for + pop pop % - + } { + { //doc-to-ucode exch get put-ucode + } forall + } ifelse +} bind def + %% When checking Resources for Font objects, we must ensure that we don't end %% up following a circular reference. Circular references in Resources should %% not, of course, be present but we've seen a number of cases. If we do detect @@ -92,19 +167,6 @@ cleartomark % discard the dict from --where-- } ifelse } bind def -/printXML { % <string> printXML - - % print non-blank lines without trailing spaces - dup dup length 1 sub -1 0 { - 1 index 1 index get 32 eq { - 0 exch getinterval exch - } { - exch = exit % non-blank on this line - } - ifelse - } for - pop pop % clean up -} bind def - /dump-pdf-info { % (fname) -> - () = ( ) print print ( has ) print PDFPageCount dup =print 10 mod 1 eq { ( page.\n) } { ( pages\n) } ifelse = flush @@ -120,24 +182,24 @@ cleartomark % discard the dict from --where-- pop Trailer /Root oget /Metadata knownoget { //false resolvestream - { dup 256 string readline exch printXML not { exit } if } loop + { dup 256 string readstring exch print not { exit } if } loop pop % done with the stream - (_____________________________________________________________) = + (\n_____________________________________________________________) = flush } if } if % Print out the "Info" dictionary if present Trailer /Info knownoget { - dup /Title knownoget { (Title: ) print = flush } if - dup /Author knownoget { (Author: ) print = flush } if - dup /Subject knownoget { (Subject: ) print = flush } if - dup /Keywords knownoget { (Keywords: ) print = flush } if - dup /Creator knownoget { (Creator: ) print = flush } if - dup /Producer knownoget { (Producer: ) print = flush } if - dup /CreationDate knownoget { (CreationDate: ) print = flush } if - dup /ModDate knownoget { (ModDate: ) print = flush } if - dup /Trapped knownoget { (Trapped: ) print = flush } if + dup /Title knownoget { (Title: ) print write-doc-string () = flush } if + dup /Author knownoget { (Author: ) print write-doc-string () = flush } if + dup /Subject knownoget { (Subject: ) print write-doc-string () = flush } if + dup /Keywords knownoget { (Keywords: ) print write-doc-string () = flush } if + dup /Creator knownoget { (Creator: ) print write-doc-string () = flush } if + dup /Producer knownoget { (Producer: ) print write-doc-string () = flush } if + dup /CreationDate knownoget { (CreationDate: ) print write-doc-string () = flush } if + dup /ModDate knownoget { (ModDate: ) print write-doc-string () = flush } if + dup /Trapped knownoget { (Trapped: ) print write-doc-string () = flush } if pop } if @@ -174,9 +236,27 @@ cleartomark % discard the dict from --where-- pop ( Page contains Annotations) print } if - pageusestransparency { + dup pageusestransparency { ( Page uses transparency features) print } if + dup pagespotcolors + dup length 0 gt { + (\n Page Spot colors: ) = + << /Black 0 /Cyan 0 /Magenta 0 /Yellow 0 >> exch + { + pop % discard the value + 1 index 1 index known not { % check if colorant is a standard one + ( ) print + (') print =print (') = + } { + pop % ignore this standard colorant + } ifelse + } forall + pop % discard dict of standard colorants + } { + pop + } ifelse + pop % done with pagedict () = flush } { @@ -193,6 +273,7 @@ cleartomark % discard the dict from --where-- ] def /res-type-dict 10 dict begin + /Font { { exch pop oforce_no_circular @@ -318,6 +399,28 @@ currentdict /res-type-dict undef currentdict /ProcessedResources undef } bind def +% If running with -dSAFER, .sort may not be present. Define a (slower) PS alternative +systemdict /.sort known not { +% <array> <lt-proc> .sort <array> + /.sort + { 1 index length 1 sub -1 1 + { 2 index exch 2 copy get 3 copy % arr proc arr i arr[i] arr i arr[i] + 0 1 3 index 1 sub + { 3 index 1 index get % arr proc arr i arr[i] arr imax amax j arr[j] + 2 index 1 index 10 index exec + { % ... amax < arr[j] + 4 2 roll + } + if pop pop + } + for % arr proc arr i arr[i] arr imax amax + 4 -1 roll exch 4 1 roll put put + } + for + pop + } bind def +} if + /dump-fonts-used { % <dict for fonts> dump-fonts-used - % If DumpFontsUsed is not true, then remove the 'standard' fonts from the list systemdict /DumpFontsUsed known not { diff --git a/lib/pfbtopfa.ps b/lib/pfbtopfa.ps index 2b69c58f..e31db5b0 100644 --- a/lib/pfbtopfa.ps +++ b/lib/pfbtopfa.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/ppath.ps b/lib/ppath.ps index 5c571019..daf7f399 100644 --- a/lib/ppath.ps +++ b/lib/ppath.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/pphs.ps b/lib/pphs.ps index 8605f2dd..78dfd060 100644 --- a/lib/pphs.ps +++ b/lib/pphs.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/prfont.ps b/lib/prfont.ps index 059d2a08..59b9c199 100644 --- a/lib/prfont.ps +++ b/lib/prfont.ps @@ -1,7 +1,7 @@ %! %%Creator: Eric Gisin <egisin@waterloo.csnet> %%Title: Print font catalog -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/ps2ai.ps b/lib/ps2ai.ps index 20ae204e..fd0dac4a 100644 --- a/lib/ps2ai.ps +++ b/lib/ps2ai.ps @@ -1,5 +1,5 @@ %! -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/ps2epsi b/lib/ps2epsi index 7590cb5a..dbfc9fb3 100755 --- a/lib/ps2epsi +++ b/lib/ps2epsi @@ -40,8 +40,8 @@ else outfile=$2 fi -# Note, we expect 'ps2epsi.ps' to be in the same directory as 'ps2epsi' +# Note, we expect 'ps2epsi.ps' to be on one of the search paths which can be seen by: gs -h "$GS_EXECUTABLE" -q -dNOOUTERSAVE -dNODISPLAY -dLastPage=1 -sOutputFile="${outfile}" \ - --permit-file-all="${infile}" -- "$LIBDIR/ps2epsi.ps" "${infile}" 1>&2 + --permit-file-all="${infile}" -- ps2epsi.ps "${infile}" 1>&2 exit 0 diff --git a/lib/ps2epsi.ps b/lib/ps2epsi.ps index 54621f92..07d19ded 100644 --- a/lib/ps2epsi.ps +++ b/lib/ps2epsi.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/rollconv.ps b/lib/rollconv.ps index 3a39e021..edeb1107 100644 --- a/lib/rollconv.ps +++ b/lib/rollconv.ps @@ -1,5 +1,5 @@ %! -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/stcinfo.ps b/lib/stcinfo.ps index dd0477c3..9f41b382 100644 --- a/lib/stcinfo.ps +++ b/lib/stcinfo.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/stcolor.ps b/lib/stcolor.ps index f14b44b8..096209fa 100644 --- a/lib/stcolor.ps +++ b/lib/stcolor.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/stocht.ps b/lib/stocht.ps index 8c9bb438..bf0c5905 100644 --- a/lib/stocht.ps +++ b/lib/stocht.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/traceimg.ps b/lib/traceimg.ps index 4ab8720f..eb5cba8c 100644 --- a/lib/traceimg.ps +++ b/lib/traceimg.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/traceop.ps b/lib/traceop.ps index ecd8ce27..7fa5bcb4 100644 --- a/lib/traceop.ps +++ b/lib/traceop.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/uninfo.ps b/lib/uninfo.ps index 98e89062..a2cff7ed 100644 --- a/lib/uninfo.ps +++ b/lib/uninfo.ps @@ -1,5 +1,5 @@ %! -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/viewcmyk.ps b/lib/viewcmyk.ps index e4250bf1..e8034e53 100644 --- a/lib/viewcmyk.ps +++ b/lib/viewcmyk.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/viewgif.ps b/lib/viewgif.ps index 55a39862..a261bf7e 100644 --- a/lib/viewgif.ps +++ b/lib/viewgif.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/viewmiff.ps b/lib/viewmiff.ps index 39d715d0..90db80b0 100644 --- a/lib/viewmiff.ps +++ b/lib/viewmiff.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/viewpbm.ps b/lib/viewpbm.ps index ec355313..c8d3f86b 100644 --- a/lib/viewpbm.ps +++ b/lib/viewpbm.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/viewpcx.ps b/lib/viewpcx.ps index 6840f1e5..76bfdfae 100644 --- a/lib/viewpcx.ps +++ b/lib/viewpcx.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/viewps2a.ps b/lib/viewps2a.ps index e0fb32bd..dafb6d5c 100644 --- a/lib/viewps2a.ps +++ b/lib/viewps2a.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/viewpwg.ps b/lib/viewpwg.ps index 9abae63a..4ee0cdb7 100644 --- a/lib/viewpwg.ps +++ b/lib/viewpwg.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2017-2018 Artifex Software, Inc. +% Copyright (C) 2017-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/viewraw.ps b/lib/viewraw.ps index f1a3f890..dee86e02 100644 --- a/lib/viewraw.ps +++ b/lib/viewraw.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/viewrgb.ps b/lib/viewrgb.ps index adde24e4..ab2f6d82 100644 --- a/lib/viewrgb.ps +++ b/lib/viewrgb.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/winmaps.ps b/lib/winmaps.ps index 75933fc2..9a4499ac 100644 --- a/lib/winmaps.ps +++ b/lib/winmaps.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/zeroline.ps b/lib/zeroline.ps index 7ace3ca3..37f9fda4 100644 --- a/lib/zeroline.ps +++ b/lib/zeroline.ps @@ -1,5 +1,5 @@ %! -% Copyright (C) 2001-2020 Artifex Software, Inc. +% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/lib/zugferd.ps b/lib/zugferd.ps new file mode 100644 index 00000000..0320fb69 --- /dev/null +++ b/lib/zugferd.ps @@ -0,0 +1,316 @@ +% Copyright (C) 2001-2021 Artifex Software, Inc. +% All Rights Reserved. +% +% This software is provided AS-IS with no warranty, either express or +% implied. +% +% This software is distributed under license and may not be copied, +% modified or distributed except as expressly authorized under the terms +% of the license contained in the file LICENSE in this distribution. +% +% Refer to licensing information at http://www.artifex.com or contact +% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato, +% CA 94945, U.S.A., +1(415)492-9861, for further information. +% +% zugferd.ps +% This program will create an (unsigned) ZUGFeRD compliant PDF file. In +% order to do so the user must provide certain information, or edit this program. +% +% Required information is the path to the XML file containing the invoice data, +% and the path to an ICC profile appropriate for the chosen ColorConversionStrategy. +% -sZUGFeRDXMLFile defines a path to the XML invoice file and -sZUGFeRDProfile +% defines the path to the ICC profile. +% +% The user must additionally set -dPDFA=3 and -sColorConversionStrategy on the +% Ghostscript command line, and set the permissions for Ghostscript to read +% both these files. It is simplest to put the files in a directory and then +% permit reading of the entire directory. +% +% Example command line : +% +% gs --permit-file-read=/usr/home/me/zugferd/ -sDEVICE=pdfwrite -dPDFA=3 -sColorConversionStrategy=RGB \ +% -sZUGFeRDXMLFile=/usr/home/me/zugferd/invoice.xml -sZUGFeRDProfile=/usr/home/me/rgb.icc \ +% -o /usr/home/me/zugferd/zugferd.pdf /usr/home/me/zugferd/zugferd.ps /usr/home/me/zugferd/original.pdf +% +% Much of this program results from a Ghostscript bug report, the thread can be found at +% https://bugs.ghostscript.com/show_bug.cgi?id=696472 Portions of the code below were +% supplied by Reinhard Nissl and I'm indebted to him for his efforts in helping me create +% a solution for this problem as well as for the code he supplied, particularly for the +% SimpleUTF16BE routine. +% +% It should not be necessary to modify this program, the comments in the code are there purely for information, +% but there are two areas which might reasonably be altered. The section with the --8<-- lines could be replaced +% with a simpler /N 3 or /N 4 if you always intend to produce the same kind of files; RGB or CMYK. +% In step 7, the large XML string will need to be replaced if you want to produce a ZUGFeRD 2.1 +% file, and in future may require similar modification for later versions. +% + +% istring SimpleUTF16BE ostring +/SimpleUTF16BE +{ + dup length + 1 add + 2 mul + string + + % istring ostring + dup 0 16#FE put + dup 1 16#FF put + 2 + 3 -1 roll + + % ostring index istring + { + % ostring index ichar + 3 1 roll + % ichar ostring index + 2 copy 16#00 put + 1 add + 2 copy + 5 -1 roll + % ostring index ostring index ichar + put + 1 add + % ostring index + } + forall + + % ostring index + pop +} +bind def + +% First check that the user has defined the XML invoice file on the command line +% +/ZUGFeRDXMLFile where { + pop % Discard the dictionary + % + % Now check that the ICC Profile is defined + % + /ZUGFeRDProfile where { + pop % Discard the dictionary + + % Step 1, add the required PDF/A boilerplate. This is mostly copied from lib/pdfa_de.ps + % Create a PDF stream object to hold the ICC profile. + [ /_objdef {icc_PDFA} /type /stream /OBJ pdfmark + + % Add the required entries to the stream dictionary (/N only) + [ {icc_PDFA} + << + %% This code attempts to set the /N (number of components) key for the ICC colour space. + %% To do this it checks the ColorConversionStrategy or the device ProcessColorModel if + %% ColorConversionStrategy is not set. + %% This is not 100% reliable. A better solution is for the user to edit this and replace + %% the code between the ---8<--- lines with a simple declaration like: + %% /N 3 + %% where the value of N is the number of components from the profile defined in ZUGFeRDProfile. + %% + %% ----------8<--------------8<-------------8<--------------8<---------- + systemdict /ColorConversionStrategy known { + systemdict /ColorConversionStrategy get cvn dup /Gray eq { + pop /N 1 false + }{ + dup /RGB eq { + pop /N 3 false + }{ + /CMYK eq { + /N 4 false + }{ + (ColorConversionStrategy not a device space, falling back to ProcessColorModel, output may not be valid PDF/A.)= + true + } ifelse + } ifelse + } ifelse + } { + (ColorConversionStrategy not set, falling back to ProcessColorModel, output may not be valid PDF/A.)= + true + } ifelse + + { + currentpagedevice /ProcessColorModel get + dup /DeviceGray eq { + pop /N 1 + }{ + dup /DeviceRGB eq { + pop /N 3 + }{ + dup /DeviceCMYK eq { + pop /N 4 + } { + (ProcessColorModel not a device space.)= + /ProcessColorModel cvx /rangecheck signalerror + } ifelse + } ifelse + } ifelse + } if + %% ----------8<--------------8<-------------8<--------------8<---------- + >> /PUT pdfmark + + % Now read the ICC profile from the file into the stream + [ {icc_PDFA} ZUGFeRDProfile (r) file /PUT pdfmark + + % Define the output intent dictionary : + [/_objdef {OutputIntent_PDFA} /type /dict /OBJ pdfmark + + % Add the required keys to the dictionary + [{OutputIntent_PDFA} << + /Type /OutputIntent + /S /GTS_PDFA1 % Required for PDF/A. + /DestOutputProfile {icc_PDFA} % The actual profile. + /OutputConditionIdentifier (Custom) % A better solution is a string from the ICC Registry, but Custom is always valid. + >> /PUT pdfmark + + % And now add the OutputIntent to the Catalog dictionary + [ {Catalog} << /OutputIntents [ {OutputIntent_PDFA} ]>> /PUT pdfmark + + + % Step 2, define the XML file and read it into the PDF + % First we define the PDF stream to contain the XML invoice + [ /_objdef {InvoiceStream} /type /stream /OBJ pdfmark + + % Fill in the dictionary elements we need. We believe the + % ModDate is not useful so it's just set to a valid value. + [ {InvoiceStream} << + /Type /EmbeddedFile + /Subtype (text/xml) cvn + /Params << + /ModDate (D:20130121081433+01’00’) + >> + >> /PUT pdfmark + + % Now read the data from the file and store it in the stream + [ {InvoiceStream} ZUGFeRDXMLFile (r) file /PUT pdfmark + + % and close the stream + [ {InvoiceStream} /CLOSE pdfmark + + + % Step 3 create the File Specification dictionary for the embedded file + % Create the dictionary + [ /_objdef {FSDict} /type /dict /OBJ pdfmark + + % Fill in the required dictionary elements + [ {FSDict} << + /Type /FileSpec + /F ZUGFeRDXMLFile + /UF ZUGFeRDXMLFile SimpleUTF16BE + /Desc (ZUGFeRD electronic invoice) + /AFRelationship /Alternative + /EF << + /F {InvoiceStream} + /UF {InvoiceStream} + >> + >> + /PUT pdfmark + + + % Step 4 Create the Associated Files dictionary to hold the FS dict + % Create the dictionary + [ /_objdef {AFArray} /type /array /OBJ pdfmark + + % Put (append) the FS dictionary into the Associated Files array + [ {AFArray} {FSDict} /APPEND pdfmark + + + % Step 5 Add an entry in the Catalog dictionary containing the AF array + [ {Catalog} << /AF {AFArray} >> /PUT pdfmark + + + % Step 6 use the EMBED pdfmark to add the XML file and FS dictionary to the PDF name tree + [ /Name ZUGFeRDXMLFile /FS {FSDict} /EMBED pdfmark + + + % Step 7 Add the extra ZUGFeRD XML data to the Metadata + [ /XML +( + <!-- XMP extension schema container for the zugferd schema --> + <rdf:Description rdf:about="" + xmlns:pdfaExtension="http://www.aiim.org/pdfa/ns/extension/" + xmlns:pdfaSchema="http://www.aiim.org/pdfa/ns/schema#" + xmlns:pdfaProperty="http://www.aiim.org/pdfa/ns/property#"> + + <!-- Container for all embedded extension schema descriptions --> + <pdfaExtension:schemas> + <rdf:Bag> + <rdf:li rdf:parseType="Resource"> + <!-- Optional description of schema --> + <pdfaSchema:schema>ZUGFeRD PDFA Extension Schema</pdfaSchema:schema> + <!-- Schema namespace URI --> + <pdfaSchema:namespaceURI>urn:ferd:pdfa:invoice:rc#</pdfaSchema:namespaceURI> + <!-- Preferred schema namespace prefix --> + <pdfaSchema:prefix>zf</pdfaSchema:prefix> + + <!-- Description of schema properties --> + <pdfaSchema:property> + <rdf:Seq>! + <rdf:li rdf:parseType="Resource"> + <!-- DocumentFileName: Name of the embedded file; + must be equal with the value of the /F tag in the /EF + structure --> + <pdfaProperty:name>DocumentFileName</pdfaProperty:name> + <pdfaProperty:valueType>Text</pdfaProperty:valueType> + <pdfaProperty:category>external</pdfaProperty:category> + <pdfaProperty:description>name of the embedded xml invoice file</pdfaProperty:description> + </rdf:li> + <rdf:li rdf:parseType="Resource"> + <!-- DocumentType: INVOICE --> + <pdfaProperty:name>DocumentType</pdfaProperty:name> + <pdfaProperty:valueType>Text</pdfaProperty:valueType> + <pdfaProperty:category>external</pdfaProperty:category> + <pdfaProperty:description>INVOICE</pdfaProperty:description> + </rdf:li> + <rdf:li rdf:parseType="Resource"> + <!-- Version: The actual version of the + ZUGFeRD standard --> + <pdfaProperty:name>Version</pdfaProperty:name> + <pdfaProperty:valueType>Text</pdfaProperty:valueType> + <pdfaProperty:category>external</pdfaProperty:category> + <pdfaProperty:description>The actual version of the ZUGFeRD data</pdfaProperty:description> + </rdf:li> + <rdf:li rdf:parseType="Resource"> + <!-- ConformanceLevel: The actual conformance + level of the ZUGFeRD standard, + e.g. BASIC, COMFORT, EXTENDED --> + <pdfaProperty:name>ConformanceLevel</pdfaProperty:name> + <pdfaProperty:valueType>Text</pdfaProperty:valueType> + <pdfaProperty:category>external</pdfaProperty:category> + <pdfaProperty:description>The conformance level of the ZUGFeRD data</pdfaProperty:description> + </rdf:li> + </rdf:Seq> + </pdfaSchema:property> + </rdf:li> + </rdf:Bag> + </pdfaExtension:schemas> + </rdf:Description> + + <rdf:Description rdf:about="" xmlns:zf="urn:ferd:pdfa:invoice:rc#"> + <zf:DocumentType>INVOICE</zf:DocumentType> + <zf:DocumentFileName>ZUGFeRD-invoice.xml</zf:DocumentFileName> + <zf:Version>RC</zf:Version> + <zf:ConformanceLevel>BASIC</zf:ConformanceLevel> + </rdf:Description> +) /Ext_Metadata pdfmark + } + { + % No ICC Profile definition on the command line; chide the user and give them an example + % + (\nERROR - ZUGFeRDProfile has not been supplied, you must supply an ICC profile\n) print + ( Producing a potentially invalid PDF/A file!!\n) print + (example usage - gs --permit-file-read=/usr/home/me/zugferd/ -sDEVICE=pdfwrite -dPDFA=3\\\n) print + ( -sColorConversionStrategy=RGB -sZUGFeRDXMLFile=/usr/home/me/zugferd/invoice.xml\\\n) print + ( -sZUGFeRDProfile=/usr/home/me/rgb.icc -o /usr/home/me/zugferd/zugferd.pdf\\\n) print + ( /usr/home/me/zugferd/zugferd.ps /usr/home/me/zugferd/original.pdf\n\n) print flush + } ifelse +} +{ + % No XML invoice definition on the command line; chide the user and give them an example + % + (\nERROR - ZUGFeRDXMLFile has not been supplied, you must supply an XML invoice file\n) print + ( Producing a PDF/A file not a ZUGFeRD file.\n) print + (example usage - gs --permit-file-read=/usr/home/me/zugferd/ -sDEVICE=pdfwrite -dPDFA=3\\\n) print + ( -sColorConversionStrategy=RGB -sZUGFeRDXMLFile=/usr/home/me/zugferd/invoice.xml\\\n) print + ( -sZUGFeRDProfile=/usr/home/me/rgb.icc -o /usr/home/me/zugferd/zugferd.pdf\\\n) print + ( /usr/home/me/zugferd/zugferd.ps /usr/home/me/zugferd/original.pdf\n\n) print flush +} ifelse + +% That's all the ZUGFeRD and PDF/A-3 setup completed, all that remains now is to run the input file |