diff options
author | Martin Kretzschmar <mkretzschmar@src.gnome.org> | 2004-05-16 22:45:42 (GMT) |
---|---|---|
committer | Martin Kretzschmar <mkretzschmar@src.gnome.org> | 2004-05-16 22:45:42 (GMT) |
commit | ad63666daeeda50acc7630132d61fe044634fddd (patch) | |
tree | 487b52b30f8a563cbb2e16c6fd2527a6eeb5990f /pdf/xpdf/pdftotext.cc | |
parent | d57c02ebc09bfd1a0cac44140ec7a80dbe43877e (diff) |
Imported Xpdf 2.03 and fixed build.
* ANNOUNCE:
* CHANGES:
* README:
* aconf2.h:
* configure.in:
* dj_make.bat:
* doc/pdffonts.1:
* doc/pdffonts.cat:
* doc/pdffonts.hlp:
* doc/pdfimages.1:
* doc/pdfimages.cat:
* doc/pdfimages.hlp:
* doc/pdfinfo.1:
* doc/pdfinfo.cat:
* doc/pdfinfo.hlp:
* doc/pdftopbm.1:
* doc/pdftopbm.cat:
* doc/pdftopbm.hlp:
* doc/pdftops.1:
* doc/pdftops.cat:
* doc/pdftops.hlp:
* doc/pdftotext.1:
* doc/pdftotext.cat:
* doc/pdftotext.hlp:
* doc/xpdf.1:
* doc/xpdf.cat:
* doc/xpdf.hlp:
* doc/xpdfrc.5:
* doc/xpdfrc.cat:
* doc/xpdfrc.hlp:
* goo/gfile.cc:
* ms_make.bat:
* vms_make.com:
* xpdf/Annot.cc:
* xpdf/Array.cc:
* xpdf/BuiltinFontTables.cc:
* xpdf/CMap.cc:
* xpdf/CMap.h:
* xpdf/Catalog.cc:
* xpdf/CharCodeToUnicode.cc:
* xpdf/CharCodeToUnicode.h:
* xpdf/Decrypt.cc:
* xpdf/Dict.cc:
* xpdf/ErrorCodes.h:
* xpdf/FTFont.cc:
* xpdf/FTFont.h:
* xpdf/FontFile.cc:
* xpdf/FontFile.h:
* xpdf/Function.cc:
* xpdf/Gfx.cc:
* xpdf/Gfx.h:
* xpdf/GfxFont.cc:
* xpdf/GfxFont.h:
* xpdf/GfxState.cc:
* xpdf/GfxState.h:
* xpdf/GlobalParams.cc:
* xpdf/GlobalParams.h:
* xpdf/JBIG2Stream.cc:
* xpdf/Link.cc:
* xpdf/Link.h:
* xpdf/Makefile.am:
* xpdf/OutputDev.h:
* xpdf/PDFDoc.cc:
* xpdf/PDFDoc.h:
* xpdf/PSOutputDev.cc:
* xpdf/PSOutputDev.h:
* xpdf/Page.cc:
* xpdf/Page.h:
* xpdf/Parser.cc:
* xpdf/Stream.cc:
* xpdf/Stream.h:
* xpdf/TTFont.cc:
* xpdf/TTFont.h:
* xpdf/TextOutputDev.cc:
* xpdf/TextOutputDev.h:
* xpdf/UnicodeMap.cc:
* xpdf/UnicodeMap.h:
* xpdf/UnicodeTypeTable.cc:
* xpdf/UnicodeTypeTable.h:
* xpdf/XOutputDev.cc:
* xpdf/XOutputDev.h:
* xpdf/XPDFApp.cc:
* xpdf/XPDFCore.cc:
* xpdf/XPDFCore.h:
* xpdf/XPDFViewer.cc:
* xpdf/XPDFViewer.h:
* xpdf/XRef.cc:
* xpdf/about-text.h:
* xpdf/config.h:
* xpdf/gpdf-control.cc:
* xpdf/gpdf-link-canvas-item.cc:
* xpdf/gpdf-links-canvas-layer.cc:
* xpdf/pdffonts.cc:
* xpdf/pdfimages.cc:
* xpdf/pdfinfo.cc:
* xpdf/pdftopbm.cc:
* xpdf/pdftops.cc:
* xpdf/pdftotext.cc:
* xpdf/tests/test-links.cc:
* xpdf/vms_make.com:
* xpdf/xpdf.cc: Imported Xpdf 2.03 and fixed build.
Diffstat (limited to 'pdf/xpdf/pdftotext.cc')
-rw-r--r-- | pdf/xpdf/pdftotext.cc | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/pdf/xpdf/pdftotext.cc b/pdf/xpdf/pdftotext.cc index a67f924..c6ad9c0 100644 --- a/pdf/xpdf/pdftotext.cc +++ b/pdf/xpdf/pdftotext.cc @@ -40,45 +40,48 @@ static GBool rawOrder = gFalse; static GBool htmlMeta = gFalse; static char textEncName[128] = ""; static char textEOL[16] = ""; -static char ownerPassword[33] = ""; -static char userPassword[33] = ""; +static GBool noPageBreaks = gFalse; +static char ownerPassword[33] = "\001"; +static char userPassword[33] = "\001"; static GBool quiet = gFalse; static char cfgFileName[256] = ""; static GBool printVersion = gFalse; static GBool printHelp = gFalse; static ArgDesc argDesc[] = { - {"-f", argInt, &firstPage, 0, + {"-f", argInt, &firstPage, 0, "first page to convert"}, - {"-l", argInt, &lastPage, 0, + {"-l", argInt, &lastPage, 0, "last page to convert"}, - {"-layout", argFlag, &physLayout, 0, + {"-layout", argFlag, &physLayout, 0, "maintain original physical layout"}, - {"-raw", argFlag, &rawOrder, 0, + {"-raw", argFlag, &rawOrder, 0, "keep strings in content stream order"}, - {"-htmlmeta", argFlag, &htmlMeta, 0, + {"-htmlmeta", argFlag, &htmlMeta, 0, "generate a simple HTML file, including the meta information"}, - {"-enc", argString, textEncName, sizeof(textEncName), + {"-enc", argString, textEncName, sizeof(textEncName), "output text encoding name"}, - {"-eol", argString, textEOL, sizeof(textEOL), + {"-eol", argString, textEOL, sizeof(textEOL), "output end-of-line convention (unix, dos, or mac)"}, - {"-opw", argString, ownerPassword, sizeof(ownerPassword), + {"-nopgbrk", argFlag, &noPageBreaks, 0, + "don't insert page breaks between pages"}, + {"-opw", argString, ownerPassword, sizeof(ownerPassword), "owner password (for encrypted files)"}, - {"-upw", argString, userPassword, sizeof(userPassword), + {"-upw", argString, userPassword, sizeof(userPassword), "user password (for encrypted files)"}, - {"-q", argFlag, &quiet, 0, + {"-q", argFlag, &quiet, 0, "don't print any messages or errors"}, - {"-cfg", argString, cfgFileName, sizeof(cfgFileName), + {"-cfg", argString, cfgFileName, sizeof(cfgFileName), "configuration file to use in place of .xpdfrc"}, - {"-v", argFlag, &printVersion, 0, + {"-v", argFlag, &printVersion, 0, "print copyright and version info"}, - {"-h", argFlag, &printHelp, 0, + {"-h", argFlag, &printHelp, 0, "print usage information"}, - {"-help", argFlag, &printHelp, 0, + {"-help", argFlag, &printHelp, 0, "print usage information"}, - {"--help", argFlag, &printHelp, 0, + {"--help", argFlag, &printHelp, 0, "print usage information"}, - {"-?", argFlag, &printHelp, 0, + {"-?", argFlag, &printHelp, 0, "print usage information"}, {NULL} }; @@ -120,6 +123,9 @@ int main(int argc, char *argv[]) { fprintf(stderr, "Bad '-eol' value on command line\n"); } } + if (noPageBreaks) { + globalParams->setTextPageBreaks(gFalse); + } if (quiet) { globalParams->setErrQuiet(quiet); } @@ -132,12 +138,12 @@ int main(int argc, char *argv[]) { } // open PDF file - if (ownerPassword[0]) { + if (ownerPassword[0] != '\001') { ownerPW = new GString(ownerPassword); } else { ownerPW = NULL; } - if (userPassword[0]) { + if (userPassword[0] != '\001') { userPW = new GString(userPassword); } else { userPW = NULL; @@ -228,7 +234,7 @@ int main(int argc, char *argv[]) { textOut = new TextOutputDev(textFileName->getCString(), physLayout, rawOrder, htmlMeta); if (textOut->isOk()) { - doc->displayPages(textOut, firstPage, lastPage, 72, 0, gFalse); + doc->displayPages(textOut, firstPage, lastPage, 72, 72, 0, gFalse); } else { delete textOut; exitCode = 2; |