summaryrefslogtreecommitdiff
path: root/Build/source/libs/xpdf/xpdf-src/xpdf/pdftotext.cc
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2017-08-13 07:14:48 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2017-08-13 07:14:48 +0000
commit4b4995cda35627e06c43e25ecbe07c1bc1859bb5 (patch)
tree143ed02a389bab62f44043a54cbc70f69e312e2f /Build/source/libs/xpdf/xpdf-src/xpdf/pdftotext.cc
parent00d00899c484b81967558f43c4fe4a896ffdf610 (diff)
xpdf 4.00
git-svn-id: svn://tug.org/texlive/trunk@45031 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/xpdf/xpdf-src/xpdf/pdftotext.cc')
-rw-r--r--Build/source/libs/xpdf/xpdf-src/xpdf/pdftotext.cc21
1 files changed, 16 insertions, 5 deletions
diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/pdftotext.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/pdftotext.cc
index 02b45f9c304..49513be5f83 100644
--- a/Build/source/libs/xpdf/xpdf-src/xpdf/pdftotext.cc
+++ b/Build/source/libs/xpdf/xpdf-src/xpdf/pdftotext.cc
@@ -15,9 +15,10 @@
# include <fenv.h>
# include <fpu_control.h>
#endif
+#include "gmem.h"
+#include "gmempp.h"
#include "parseargs.h"
#include "GString.h"
-#include "gmem.h"
#include "GlobalParams.h"
#include "Object.h"
#include "Stream.h"
@@ -37,15 +38,18 @@
static int firstPage = 1;
static int lastPage = 0;
static GBool physLayout = gFalse;
+static GBool simpleLayout = gFalse;
static GBool tableLayout = gFalse;
static GBool linePrinter = gFalse;
static GBool rawOrder = gFalse;
static double fixedPitch = 0;
static double fixedLineSpacing = 0;
static GBool clipText = gFalse;
+static GBool discardDiag = gFalse;
static char textEncName[128] = "";
static char textEOL[16] = "";
static GBool noPageBreaks = gFalse;
+static GBool insertBOM = gFalse;
static char ownerPassword[33] = "\001";
static char userPassword[33] = "\001";
static GBool quiet = gFalse;
@@ -60,6 +64,8 @@ static ArgDesc argDesc[] = {
"last page to convert"},
{"-layout", argFlag, &physLayout, 0,
"maintain original physical layout"},
+ {"-simple", argFlag, &simpleLayout, 0,
+ "simple one-column page layout"},
{"-table", argFlag, &tableLayout, 0,
"similar to -layout, but optimized for tables"},
{"-lineprinter", argFlag, &linePrinter, 0,
@@ -72,12 +78,16 @@ static ArgDesc argDesc[] = {
"fixed line spacing for LinePrinter mode"},
{"-clip", argFlag, &clipText, 0,
"separate clipped text"},
+ {"-nodiag", argFlag, &discardDiag, 0,
+ "discard diagonal text"},
{"-enc", argString, textEncName, sizeof(textEncName),
"output text encoding name"},
{"-eol", argString, textEOL, sizeof(textEOL),
"output end-of-line convention (unix, dos, or mac)"},
{"-nopgbrk", argFlag, &noPageBreaks, 0,
"don't insert page breaks between pages"},
+ {"-bom", argFlag, &insertBOM, 0,
+ "insert a Unicode BOM at the start of the text file"},
{"-opw", argString, ownerPassword, sizeof(ownerPassword),
"owner password (for encrypted files)"},
{"-upw", argString, userPassword, sizeof(userPassword),
@@ -121,7 +131,7 @@ int main(int argc, char *argv[]) {
// emulation (yes, this is a kludge; but it's pretty much
// unavoidable given the x87 instruction set; see gcc bug 323 for
// more info)
- fpu_control_t cw;
+ fpu_control_t cw;
_FPU_GETCW(cw);
cw = (cw & ~_FPU_EXTENDED) | _FPU_DOUBLE;
_FPU_SETCW(cw);
@@ -129,9 +139,6 @@ int main(int argc, char *argv[]) {
exitCode = 99;
-#ifdef _MSC_VER
- (void)kpse_set_program_name(argv[0], NULL);
-#endif
// parse args
ok = parseArgs(argDesc, &argc, argv);
if (!ok || argc < 2 || argc > 3 || printVersion || printHelp) {
@@ -228,6 +235,8 @@ int main(int argc, char *argv[]) {
} else if (physLayout) {
textOutControl.mode = textOutPhysLayout;
textOutControl.fixedPitch = fixedPitch;
+ } else if (simpleLayout) {
+ textOutControl.mode = textOutSimpleLayout;
} else if (linePrinter) {
textOutControl.mode = textOutLinePrinter;
textOutControl.fixedPitch = fixedPitch;
@@ -238,6 +247,8 @@ int main(int argc, char *argv[]) {
textOutControl.mode = textOutReadingOrder;
}
textOutControl.clipText = clipText;
+ textOutControl.discardDiagonalText = discardDiag;
+ textOutControl.insertBOM = insertBOM;
textOut = new TextOutputDev(textFileName->getCString(), &textOutControl,
gFalse);
if (textOut->isOk()) {