1EXTRACTPDFMARK(1)           General Commands Manual          EXTRACTPDFMARK(1)
2
3
4

NAME

6       extractpdfmark  -  Extract  page mode and named destinations as PDFmark
7       from PDF
8

SYNOPSIS

10       extractpdfmark file.pdf > file.ps
11

DESCRIPTION

13       This manual page documents briefly the extractpdfmark command.
14
15       When you create a PDF document using a TeX system, you may include many
16       small  PDF  files in the main PDF file.  It is common for each of those
17       files to use the same fonts.
18
19       If the small PDF files contain embedded font subsets,  the  TeX  system
20       includes  them  as-is in the main PDF.  As a result, several subsets of
21       the same font are embedded in the main PDF.   It  is  not  possible  to
22       remove  the duplicates since the subsets differ.  This vastly increases
23       the size of the main PDF file.
24
25       On the other hand, if the small PDF files contain  embedded  full  font
26       sets,  the  TeX system also includes all of them in the main PDF.  This
27       time, the main PDF contains duplicates of the same full sets of  fonts.
28       Therefore,  Ghostscript  can remove the duplicates.  This may consider‐
29       ably reduce the main PDF-file's size.  (Note: Ghostscript 9.17  -  9.21
30       needs  -dPDFDontUseFontObjectNum commandline option for removing dupli‐
31       cate fonts.  If you use Ghostscript 9.22+, you cannot  use  this  "full
32       set  embedding" method since it cannot remove duplicate fonts.  In this
33       case, you can use "*not* embedding" method as following.)
34
35       Finally, if the small PDF files contain some fonts that are not  embed‐
36       ded,  the TeX system outputs the main PDF file with some fonts missing.
37       In this case, Ghostscript can embed the necessary fonts.  It  can  also
38       significantly reduce the required disk size.
39
40       Either  way,  when  Ghostscript  reads the main PDF produced by the TeX
41       system and outputs the final PDF it does not preserve PDF page-mode and
42       named-destinations,  etc.  As a result, when you open the final PDF, it
43       is not displayed correctly.  Also, remote PDF links will not work.
44
45       This program is able to extract the page mode and named destinations as
46       PDFmark  from  PDF.  By using this you can get the small PDF files that
47       have preserved them.
48

EXAMPLE

50       $ extractpdfmark TeX-System-Outputted.pdf > Extracted-PDFmark.ps
51       $ gs -q -dBATCH -dNOPAUSE -sDEVICE=pdfwrite \
52            -dPDFDontUseFontObjectNum -dPrinted=false \
53            -sOutputFile=Final.pdf \
54            TeX-System-Outputted.pdf Extracted-PDFmark.ps
55
56       (Note: Ghostscript 9.26+ needs -dPrinted=false commandline option.)
57
58
59
60                               January 26, 2019              EXTRACTPDFMARK(1)
Impressum