summaryrefslogtreecommitdiff
path: root/test/pdfclean.c
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2004-12-13 09:37:48 +0100
committerTor Andersson <tor@ghostscript.com>2004-12-13 09:37:48 +0100
commit72976993f5b39d9ee1599dc89961288b297cdc62 (patch)
tree131098a8e8c2de04766181aeddc8a13aebb2981d /test/pdfclean.c
parent690dabe2db5f440b9bbb4c4eecbeeb77635a22b4 (diff)
downloadmupdf-72976993f5b39d9ee1599dc89961288b297cdc62.tar.xz
clean up nametree and outlines
Diffstat (limited to 'test/pdfclean.c')
-rw-r--r--test/pdfclean.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/test/pdfclean.c b/test/pdfclean.c
index 32acacd9..a55b94ef 100644
--- a/test/pdfclean.c
+++ b/test/pdfclean.c
@@ -5,7 +5,7 @@ void usage()
{
fprintf(stderr,
"usage: pdfclean [options] infile.pdf outfile.pdf\n"
- " -r\treconstruct broken xref table\n"
+ " -r\trebuild xref table\n"
" -g\tgarbage collect unused objects\n"
" -x\texpand compressed streams\n"
" -d -\tset user password for decryption\n"
@@ -118,14 +118,16 @@ int main(int argc, char **argv)
infile = argv[optind++];
outfile = argv[optind++];
+ error = pdf_newxref(&xref);
+
if (dorepair)
- error = pdf_repairpdf(&xref, infile);
+ error = pdf_repairxref(xref, infile);
else
- error = pdf_openpdf(&xref, infile);
+ error = pdf_loadxref(xref, infile);
if (error)
fz_abort(error);
- error = pdf_decryptpdf(xref);
+ error = pdf_decryptxref(xref);
if (error)
fz_abort(error);
@@ -157,14 +159,14 @@ int main(int argc, char **argv)
pdf_garbagecollect(xref);
}
- error = pdf_savepdf(xref, outfile, encrypt);
+ error = pdf_savexref(xref, outfile, encrypt);
if (error)
fz_abort(error);
if (encrypt)
pdf_dropcrypt(encrypt);
- pdf_closepdf(xref);
+ pdf_closexref(xref);
return 0;
}