summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/pdf_info.ps160
-rw-r--r--lib/viewcmyk.ps2
-rw-r--r--lib/viewjpeg.ps3
-rw-r--r--lib/viewpbm.ps2
-rw-r--r--lib/viewpcx.ps2
-rw-r--r--lib/viewraw.ps2
-rw-r--r--lib/viewrgb.ps2
-rw-r--r--lib/zugferd.ps2
8 files changed, 173 insertions, 2 deletions
diff --git a/lib/pdf_info.ps b/lib/pdf_info.ps
index 35951e9a..2a5f5796 100644
--- a/lib/pdf_info.ps
+++ b/lib/pdf_info.ps
@@ -527,6 +527,164 @@ systemdict /.sort known not {
} ifelse
} bind def
-enum-pdfs
+/NEWPDF where {/NEWPDF get}{false}ifelse
+{
+ /knownoget
+ {
+ 2 copy known {
+ get
+ true
+ }{
+ pop pop false
+ } ifelse
+ }bind def
+
+ /PDFContext << >> .PDFInit def
+ {File (r) file PDFContext .PDFStream} stopped not
+ {
+
+ PDFContext .PDFInfo
+ File
+ () = ( ) print print ( has ) print
+ dup /NumPages get dup =print 10 mod 1 eq { ( page.\n) } { ( pages\n) } ifelse = flush
+
+ /DumpXML where {/DumpXML get}{//false}ifelse
+ {
+ (\n*** DumpXML is no longer supported. ***\n\n) print
+ }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
+ (\n) print flush
+
+ /EmbeddedFonts 10 dict def
+ /UnEmbeddedFonts 10 dict def
+ /FontNumbers 10 dict def
+
+ /NumPages get 0 1 3 -1 roll 1 sub
+ {
+ dup
+ PDFContext exch .PDFPageInfoExt exch
+ DumpMediaSizes {
+ (Page ) print 1 add =print
+ dup /UserUnit knownoget {( UserUnit: ) print =print} if
+ dup /MediaBox knownoget {( MediaBox: ) print ==only} if
+ dup /CropBox knownoget {( CropBox: ) print ==only} if
+ dup /BleedBox knownoget {( BleedBox: ) print ==only} if
+ dup /TrimBox knownoget {( TrimBox: ) print ==only} if
+ dup /ArtBox knownoget {( ArtBox: ) print ==only} if
+ dup /Rotate knownoget not {0}if ( Rotate = ) print =print
+ dup /Annots knownoget {{( Page contains Annotations) print} if} if
+ dup /UsesTransparency knownoget {{( Page uses transparency features) print} if} if
+ dup /Spots knownoget {
+ (\n Page Spot colors: ) =
+ {( ) print (') print 256 string cvs print (') =} forall
+ } if
+ (\n) print flush
+ (\n) print flush
+ }
+ {
+ pop
+ } ifelse
+
+ /Fonts knownoget
+ {
+ {
+ dup /ObjectNum known
+ {
+ %% Fonts with an ObjectNumber may have been previously referenced on another page
+ dup /ObjectNum get
+ dup FontNumbers exch known
+ {
+ pop
+ %% found the ObjectNumber in the FontNumbers dictionary so we've seen this one.
+ //false
+ }
+ {
+ %% Not seen before, add the number to the array and process this font
+ FontNumbers exch dup put
+ //true
+ }ifelse
+ }{
+ %% Fonts without an ObjectNumber are defined inline and so must be unique
+ //true
+ } ifelse
+ {
+ % First time we've seen the font
+ dup /Descendants known
+ {
+ dup /BaseFont get
+ EmbeddedFonts exch dup put % We class the Type 0 font as 'embedded', but it's really the descendant which is embedded or not.
+ dup /Descendants get
+ 1 index /BaseFont get
+ 2 index /Embedded get
+ {
+ EmbeddedFonts exch dup put
+ }
+ {
+ UnEmbeddedFonts exch dup put
+ }ifelse
+ pop
+ }
+ {
+ dup /BaseFont get
+ 1 index /Embedded get
+ {
+ EmbeddedFonts exch dup put
+ }
+ {
+ UnEmbeddedFonts exch dup put
+ } ifelse
+ }ifelse
+ pop
+ }
+ {
+ pop
+ } ifelse
+ }forall
+ } if
+ } for
+
+ /DumpFontsUsed where {/DumpFontsUsed get}{//false}ifelse
+ {
+ [
+ UnEmbeddedFonts {pop} forall
+ /ShowEmbeddedFonts where {/ShowEmbeddedFonts get}{//false}ifelse
+ {
+ EmbeddedFonts {pop} forall
+ } if
+ ]
+ dup length 0 gt {
+ { 100 string cvs exch 100 string cvs exch lt } .sort
+ (\nFont or CIDFont resources used (plain name and ASCIIHEX string representation):) =
+ { 128 string cvs dup print ( ) print (<) print 128 string cvs {16 8 string cvrs print} forall (>) print (\n) print} forall
+ } if
+ }
+ {
+ [
+ DumpFontsNeeded
+ {
+ UnEmbeddedFonts {pop} forall
+ } if
+ ]
+ dup length 0 gt {
+ { 100 string cvs exch 100 string cvs exch lt } .sort
+ (\nFonts Needed that are not embedded \(system fonts required\):) =
+ { ( ) print 128 string cvs dup print ( ) print (<) print {16 8 string cvrs print} forall (>) print (\n) print} forall
+ } if
+ }ifelse
+ } if
+ PDFContext .PDFClose
+}
+{
+ enum-pdfs
+} ifelse
end
quit
diff --git a/lib/viewcmyk.ps b/lib/viewcmyk.ps
index e8034e53..33c5bdce 100644
--- a/lib/viewcmyk.ps
+++ b/lib/viewcmyk.ps
@@ -56,6 +56,8 @@
cleartomark
(Usage: gs -- viewcmyk.ps filename.cmyk width\n) print
( e.g.: gs -- viewcmyk.ps my.cmyk 2550\n) print flush
+ (From version 9.50 you must supply permissions for this program to read the input file(s)\n) print flush
+ (either by using -dNOSAFER or by supplying --permit-file-read=<filename>\n) = flush
} ifelse
} {
pop
diff --git a/lib/viewjpeg.ps b/lib/viewjpeg.ps
index 71cb5d44..54453fe4 100644
--- a/lib/viewjpeg.ps
+++ b/lib/viewjpeg.ps
@@ -35,6 +35,9 @@
% Usage example:
% (jpeg-6/testimg.jpg) viewJPEG
+% From version 9.50 you must supply permissions for this program
+% to read the input file(s) either by using -dNOSAFER or by
+% supplying --permit-file-read=<filename>
/languagelevel where {pop languagelevel 2 lt}{true} ifelse {
(JPEG needs PostScript Level 2!\n) print flush stop
diff --git a/lib/viewpbm.ps b/lib/viewpbm.ps
index c8d3f86b..143a056a 100644
--- a/lib/viewpbm.ps
+++ b/lib/viewpbm.ps
@@ -327,6 +327,8 @@
( e.g.: gs [-dSCALE=#.#] [-dFITPAGE] [--] viewpbm.ps my.ppm another.ppm\n) print flush
( also -dTAG option can be used to show the pseudo-color tag image from a\n) print flush
( P7 RGB_TAG PAM file created by the bitrgbtags device.\n) print flush
+ (From version 9.50 you must supply permissions for this program to read the input file(s)\n) print flush
+ (either by using -dNOSAFER or by supplying --permit-file-read=<filename>\n) = flush
}
ifelse
}
diff --git a/lib/viewpcx.ps b/lib/viewpcx.ps
index 76bfdfae..0b549ad9 100644
--- a/lib/viewpcx.ps
+++ b/lib/viewpcx.ps
@@ -183,6 +183,8 @@
{ cleartomark
(Usage: gs -- viewpcx.ps filename.pcx ...\n) print
( e.g.: gs -- viewpcx.ps my.pcx another.pcx\n) print flush
+ (From version 9.50 you must supply permissions for this program to read the input file(s)\n) print flush
+ (either by using -dNOSAFER or by supplying --permit-file-read=<filename>\n) = flush
}
ifelse
}
diff --git a/lib/viewraw.ps b/lib/viewraw.ps
index dee86e02..85438ffa 100644
--- a/lib/viewraw.ps
+++ b/lib/viewraw.ps
@@ -181,6 +181,8 @@
cleartomark
(Usage: gs -- viewraw filename.raw width\n) print
( e.g.: gs -- viewraw my.raw 2550\n) print flush
+ (From version 9.50 you must supply permissions for this program to read the input file(s)\n) print flush
+ (either by using -dNOSAFER or by supplying --permit-file-read=<filename>\n) = flush
} ifelse
} {
pop
diff --git a/lib/viewrgb.ps b/lib/viewrgb.ps
index ab2f6d82..c2c34fec 100644
--- a/lib/viewrgb.ps
+++ b/lib/viewrgb.ps
@@ -143,6 +143,8 @@
( e.g.: gs -- viewrgb.ps my.rgb 2550\n) print flush
( -dSCALE=### sets specific scaling \(default = 1.0\)) = flush
( -dBITS=# sets the BitsPerComponent \(1, 2, 8, 12] \(default = 1\)) = flush
+ (From version 9.50 you must supply permissions for this program to read the input file(s)\n) print flush
+ (either by using -dNOSAFER or by supplying --permit-file-read=<filename>\n) = flush
} ifelse
} {
pop
diff --git a/lib/zugferd.ps b/lib/zugferd.ps
index 97d33d4d..d20c39ed 100644
--- a/lib/zugferd.ps
+++ b/lib/zugferd.ps
@@ -455,7 +455,7 @@ ZUGFeRDVersion (2p1) eq {
[ /_objdef {FSDict} /type /dict /OBJ pdfmark
% Fill in the required dictionary elements
[ {FSDict} <<
- /Type /FileSpec
+ /Type /Filespec
/F ZUGFeRDDocumentFileName
/UF ZUGFeRDDocumentFileName SimpleUTF16BE
/Desc (ZUGFeRD electronic invoice)