1 .TH pdftosrc 1 "16 June 2015" "Web2C @VERSION@"
3 pdftosrc \- extract source file or stream from PDF file
7 .RI [ stream-object-number ]
13 extracts the embedded source file
14 from the first found stream object
15 with /Type /SourceFile within the
17 and writes it to a file with the name /SourceName
18 as defined in that PDF stream object
19 (see application example below).
24 .I stream-object-number
25 are given as arguments, and
26 .I stream-object-number
29 extracts and uncompresses the PDF stream of the object
31 .I stream-object-number
34 and writes it to a file named
35 .IR PDF-file . stream-object-number
40 stripped from the original
44 A special case is related to XRef object streams that are part
45 of the PDF standard from PDF-1.5 onward:
47 .I stream-object-number
51 decompresses the XRef stream from the PDF file and writes it
52 in human-readable PDF cross-reference table format to a file named
54 (these XRef streams can not be extracted just by giving their object number).
57 an existing file with the output file name will be overwritten.
66 At success the exit code of
70 All messages go to stderr.
71 At program invocation,
73 issues the current version number of the program
85 was successful with the output file writing,
86 one of the following messages will be issued:
89 Source file extracted to
96 Stream object extracted to
97 .IR PDF-file . stream-object-number
103 Cross-reference table extracted to
109 When the object given by the
110 .I stream-object-number
111 does not contain a stream,
113 issues the following error message:
121 can't be opened, the error message is:
124 Error: Couldn't open file
130 encounters an invalid PDF file,
131 the error message (several lines) is:
134 Error: May not be a PDF file (continuing anyway)
143 There are also more error messages from
145 for various kinds of broken PDF files.
147 An embedded source file will be written out unchanged,
148 i. e. it will not be uncompressed in this process.
150 Only the stream of the object will be written,
151 i. e. not the dictionary of that object.
154 .I stream-object-number
155 to query requires information about the PDF file
156 that has to be gained elsewhere,
157 e. g. by looking into the PDF file with an editor.
159 The stream extraction capabilities of
161 (e. g. regarding understood PDF versions and filter types)
162 follow the capabilities of the underlying
166 Currently the generation number of the stream object
168 The default value 0 (zero) is taken.
171 .I stream-object-number
172 has nothing to do with the `object streams' introduced
173 by the Adobe PDF Reference,
174 5th edition, version 1.6.
177 a source file can be embedded into some
179 by using pdftex primitives,
180 as illustrated by the following example:
184 stream attr {/Type /SourceFile /SourceName (myfile.zip)}
190 \\pdfcatalog{/SourceObject \\the\\pdflastobj\\space 0 R}
192 Then this zip file can be extracted from the
198 Not all embedded source files will be extracted,
199 only the first found one.
210 written by Han The Thanh, using
212 functionality from Derek Noonburg.
214 Man page written by Hartmut Henkel.
216 Copyright (c) 1996-2006 Han The Thanh, <thanh@pdftex.org>
218 This file is part of pdfTeX.
220 pdfTeX is free software; you can redistribute it and/or modify
221 it under the terms of the GNU General Public License as published by
222 the Free Software Foundation; either version 2 of the License, or
223 (at your option) any later version.
225 pdfTeX is distributed in the hope that it will be useful,
226 but WITHOUT ANY WARRANTY; without even the implied warranty of
227 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
228 GNU General Public License for more details.
230 You should have received a copy of the GNU General Public License
231 along with pdfTeX; if not, write to the Free Software
232 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA