1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
.TH EXTRACTPDFMARK 1 "January 26, 2019"
.SH NAME
extractpdfmark \- Extract page mode and named destinations as PDFmark from PDF
.SH SYNOPSIS
.B extractpdfmark
.IR file.pdf " > " file.ps
.SH DESCRIPTION
This manual page documents briefly the
.B extractpdfmark
command.
.PP
When you create a PDF document using a TeX system, you may include
many small PDF files in the main PDF file.
It is common for each of those files to use the same fonts.
.PP
If the small PDF files contain embedded font subsets, the TeX system
includes them as-is in the main PDF.
As a result, several subsets of the same font are embedded in the main PDF.
It is not possible to remove the duplicates since the subsets differ.
This vastly increases the size of the main PDF file.
.PP
On the other hand, if the small PDF files contain embedded full font
sets, the TeX system also includes all of them in the main PDF.
This time, the main PDF contains duplicates of the same full sets of
fonts.
Therefore, Ghostscript can remove the duplicates.
This may considerably reduce the main PDF\-file's size.
(Note: Ghostscript 9.17 - 9.21 needs
.I -dPDFDontUseFontObjectNum
commandline option for removing duplicate fonts.
If you use Ghostscript 9.22+, you cannot use this "full set embedding" method
since it cannot remove duplicate fonts.
In this case, you can use "*not* embedding" method as following.)
.PP
Finally, if the small PDF files contain some fonts that are not
embedded, the TeX system outputs the main PDF file with some fonts
missing.
In this case, Ghostscript can embed the necessary fonts.
It can also significantly reduce the required disk size.
.PP
Either way, when Ghostscript reads the main PDF produced by the
TeX system and outputs the final PDF it does not preserve PDF
page\-mode and named\-destinations, etc.
As a result, when you open the final PDF, it is not displayed correctly.
Also, remote PDF links will not work.
.PP
This program is able to extract the page mode and named destinations
as PDFmark from PDF.
By using this you can get the small PDF files that have preserved them.
.SH EXAMPLE
.EX
$ extractpdfmark TeX-System-Outputted.pdf > Extracted-PDFmark.ps
$ gs -q -dBATCH -dNOPAUSE -sDEVICE=pdfwrite \e
-dPDFDontUseFontObjectNum -dPrinted=false \e
-sOutputFile=Final.pdf \e
TeX-System-Outputted.pdf Extracted-PDFmark.ps
.EE
.PP
(Note: Ghostscript 9.26+ needs
.I -dPrinted=false
commandline option.)
|