summaryrefslogtreecommitdiff
path: root/Resource
diff options
context:
space:
mode:
authorKen Sharp <ken.sharp@artifex.com>2022-05-08 15:13:16 +0100
committerKen Sharp <ken.sharp@artifex.com>2022-05-10 11:27:36 +0100
commit398bfc844bde6e2b2a4f6552ce326ad619471316 (patch)
tree88a4a82e5f1b00ac5654186c16d7c0afe1058d3f /Resource
parentbdc105a686f0c8fa1e29312302091685d27a9464 (diff)
downloadghostpdl-398bfc844bde6e2b2a4f6552ce326ad619471316.tar.gz
GhostPDF - revamp PDF information extraction
A customer requested that we make pdf_info.ps work with the new PDF interpreter, and generate the same information. This commit modifies the way we extract information on a page-by-page basis to potentially include the names of spot inks and information about fonts used on the page. This is now returned to the PostScript environment using a PDF dictionary instead of a C structure. The pdf_info.ps program has been updated so that it use the new information in broadly the same way as the information from the old PDF interpreter. There are differences; pdf_info.ps extracts font information itself, rather than having the interpreter do it. This is not possible with the new interpreter which is why we have the PDF interpreter do it for us. In addition the pdf_info.ps program only descended to the page level whereas the new PDF interpreter evaluates all objects on the page, potentially meaning that more fonts (and technically spot inks) might be detected. We now have an additional PostScript operator '.PDFPageInfoExt' which returns 'extended' information about a page. This is the same as .PDFPageInfo but includes the font and spot ink information. Running with -dPDFINFO using either Ghostscript or GhostPDF will print more information than before, including the spot inks and considerably more information about fonts than the pdf_info.ps program emits, including embedding status, descendant fonts (and their membedding status) and the presence of ToUnicode CMaps. Updated documentation for all of the above.
Diffstat (limited to 'Resource')
-rw-r--r--Resource/Init/pdf_main.ps12
1 files changed, 9 insertions, 3 deletions
diff --git a/Resource/Init/pdf_main.ps b/Resource/Init/pdf_main.ps
index a49924881..c12fc3693 100644
--- a/Resource/Init/pdf_main.ps
+++ b/Resource/Init/pdf_main.ps
@@ -1068,9 +1068,15 @@ currentdict /PDFSwitches undef
/newpdf_pdfshowpage
{
- pdfshowpage_init
- pdfshowpage_setpage
- pdfshowpage_finish
+ /PDFINFO where {/PDFINFO get}{//false}ifelse
+ {
+ /Page# get PDFFile exch 1 sub {.PDFDrawPage} stopped pop
+ }
+ {
+ pdfshowpage_init
+ pdfshowpage_setpage
+ pdfshowpage_finish
+ }ifelse
} bind def
/newpdf_runpdfend