Line 0
Link Here
|
|
|
1 |
.\" Process this file with |
2 |
.\" groff -man -Tascii pdftosrc.1 |
3 |
.\" |
4 |
.\" $Id: pdftosrc.1,v 1.3 2005/11/04 18:55:24 hhenkel Exp $ |
5 |
.\" |
6 |
.TH pdftosrc 1 "3 November 2005" "User Manuals" |
7 |
.SH NAME |
8 |
pdftosrc \- extract source file or stream from PDF file |
9 |
.SH SYNOPSIS |
10 |
.B pdftosrc |
11 |
.I PDF-file |
12 |
.R [ |
13 |
.I stream-object-number |
14 |
.R ] |
15 |
.SH DESCRIPTION |
16 |
If only |
17 |
.I PDF-file |
18 |
is given as argument, |
19 |
.B pdftosrc |
20 |
extracts the embedded source file |
21 |
from the first found stream object |
22 |
with /Type /SourceFile within the |
23 |
.I PDF-file |
24 |
and writes it to a file with the name /SourceName |
25 |
as defined in that PDF stream object |
26 |
(see application example below). |
27 |
|
28 |
If both |
29 |
.I PDF-file |
30 |
and |
31 |
.I stream-object-number |
32 |
are given as arguments, |
33 |
.B pdftosrc |
34 |
extracts and uncompresses the PDF stream of the object |
35 |
given by its |
36 |
.I stream-object-number |
37 |
from the |
38 |
.I PDF-file |
39 |
and writes it to a file named |
40 |
.IR PDF-file . stream-object-number |
41 |
with the ending |
42 |
.I .pdf |
43 |
or |
44 |
.I .PDF |
45 |
stripped from the original |
46 |
.I PDF-file |
47 |
name. |
48 |
|
49 |
In either case |
50 |
an existing file with the output file name will be overwritten. |
51 |
.SH OPTIONS |
52 |
None. |
53 |
.SH FILES |
54 |
Just the executable |
55 |
.BR pdftosrc . |
56 |
.SH ENVIRONMENT |
57 |
None. |
58 |
.SH DIAGNOSTICS |
59 |
At success the exit code of |
60 |
.B pdftosrc |
61 |
is 0, else 1. |
62 |
|
63 |
All messages go to stderr. |
64 |
At program invocation, |
65 |
.B pdftosrc |
66 |
issues the current version number of the program |
67 |
.BR xpdf , |
68 |
on which |
69 |
.B pdftosrc |
70 |
is based: |
71 |
|
72 |
.RS |
73 |
pdftosrc version 3.00 |
74 |
|
75 |
.RE |
76 |
When |
77 |
.B pdftosrc |
78 |
was successful with the output file writing, |
79 |
one of the following messages will be issued: |
80 |
|
81 |
.RS |
82 |
Source file extracted to |
83 |
.I source-file-name |
84 |
|
85 |
.RE |
86 |
or |
87 |
|
88 |
.RS |
89 |
Stream object extracted to |
90 |
.IR PDF-file . stream-object-number |
91 |
|
92 |
.RE |
93 |
|
94 |
.RE |
95 |
When the object given by the |
96 |
.I stream-object-number |
97 |
does not contain a stream, |
98 |
.B pdftosrc |
99 |
issues the following error message: |
100 |
|
101 |
.RS |
102 |
Not a Stream object |
103 |
|
104 |
.RE |
105 |
When the |
106 |
.I PDF-file |
107 |
can't be opened, the error message is: |
108 |
|
109 |
.RS |
110 |
Error: Couldn't open file |
111 |
.RI ' PDF-file '. |
112 |
|
113 |
.RE |
114 |
When |
115 |
.B pdftosrc |
116 |
encounters an invalid PDF file, |
117 |
the error message (several lines) is: |
118 |
|
119 |
.RS |
120 |
Error: May not be a PDF file (continuing anyway) |
121 |
.RE |
122 |
.RS |
123 |
(more lines) |
124 |
.RE |
125 |
.RS |
126 |
Invalid PDF file |
127 |
|
128 |
.RE |
129 |
There are also more error messages from |
130 |
.B pdftosrc |
131 |
for various kinds of broken PDF files. |
132 |
.SH NOTES |
133 |
An embedded source file will be written out unchanged, |
134 |
i. e. it will not be uncompressed in this process. |
135 |
|
136 |
Only the stream of the object will be written, |
137 |
i. e. not the dictionary of that object. |
138 |
|
139 |
Knowing which |
140 |
.I stream-object-number |
141 |
to query requires information about the PDF file |
142 |
that has to be gained elsewhere, |
143 |
e. g. by looking into the PDF file with an editor. |
144 |
|
145 |
The stream extraction capabilities of |
146 |
.B pdftosrc |
147 |
(e. g. regarding understood PDF versions and filter types) |
148 |
follow the capabilities of the underlying |
149 |
.B xpdf |
150 |
program version. |
151 |
|
152 |
Currently the generation number of the stream object |
153 |
is not supported. |
154 |
The default value 0 (zero) is taken. |
155 |
|
156 |
The wording |
157 |
.I stream-object-number |
158 |
has nothing to do with the `object streams' introduced |
159 |
by the Adobe PDF Reference, |
160 |
5th edition, version 1.6. |
161 |
.SH EXAMPLES |
162 |
When using pdftex or pdfetex, |
163 |
a source file can be embedded into some |
164 |
.I PDF-file |
165 |
by using pdftex primitives, |
166 |
as illustrated by the following example: |
167 |
|
168 |
\\immediate\\pdfobj |
169 |
.RE |
170 |
stream attr {/Type /SourceFile /SourceName (myfile.zip)} |
171 |
.RS |
172 |
.RE |
173 |
file{myfile.zip} |
174 |
.RS |
175 |
.RE |
176 |
\\pdfcatalog{/SourceObject \\the\\pdflastobj\\space 0 R} |
177 |
|
178 |
Then this zip file can be extracted from the |
179 |
.I PDF-file |
180 |
by calling |
181 |
.B pdftosrc |
182 |
.IR PDF-file . |
183 |
.SH BUGS |
184 |
Not all embedded source files will be extracted, |
185 |
only the first found one. |
186 |
|
187 |
Email bug reports to |
188 |
.B pdftex@tug.org. |
189 |
.SH SEE ALSO |
190 |
.BR xpdf (1), |
191 |
.BR pdfimages (1), |
192 |
.BR pdftotext (1), |
193 |
.BR pdftex (1), |
194 |
.BR pdfetex (1). |
195 |
.SH AUTHORS |
196 |
.B pdftosrc |
197 |
written by Han The Thanh, using |
198 |
.B xpdf |
199 |
functionality from Derek Noonburg. |
200 |
|
201 |
Man page written by Hartmut Henkel. |
202 |
.SH COPYRIGHT |
203 |
Copyright (c) 1996-2002 Han The Thanh, <thanh@pdftex.org> |
204 |
|
205 |
This file is part of pdfTeX. |
206 |
|
207 |
pdfTeX is free software; you can redistribute it and/or modify |
208 |
it under the terms of the GNU General Public License as published by |
209 |
the Free Software Foundation; either version 2 of the License, or |
210 |
(at your option) any later version. |
211 |
|
212 |
pdfTeX is distributed in the hope that it will be useful, |
213 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
214 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
215 |
GNU General Public License for more details. |
216 |
|
217 |
You should have received a copy of the GNU General Public License |
218 |
along with pdfTeX; if not, write to the Free Software |
219 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |