Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pdf/xpdf/pdftops.cc
diff options
context:
space:
mode:
authorMartin Kretzschmar <mkretzschmar@src.gnome.org>2004-05-17 19:37:57 (GMT)
committer Martin Kretzschmar <mkretzschmar@src.gnome.org>2004-05-17 19:37:57 (GMT)
commit6c85243ff859071be4fd2a3847b0fc2086206d31 (patch)
tree68b85384564a33061b32d5668c0eff7067a39ffc /pdf/xpdf/pdftops.cc
parentaf15b57b30fcf442262f3a797d169d6bc3c1a44a (diff)
Imported Xpdf 3.00 and fixed build.
* ANNOUNCE: * CHANGES: * Makefile.am: * README: * aconf-win32.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: * fofi/Makefile.in: * goo/GHash.cc: * goo/GHash.h: * ms_make.bat: * splash/Makefile.in: * xpdf/DisplayFontTable.h: * xpdf/ErrorCodes.h: * xpdf/FTFont.cc: * xpdf/FTFont.h: * xpdf/FontFile.cc: * xpdf/FontFile.h: * xpdf/Function.h: * xpdf/GPOutputDev.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/Makefile.am: * xpdf/Object.cc: * xpdf/Object.h: * xpdf/Outline.cc: * xpdf/OutputDev.cc: * xpdf/OutputDev.h: * xpdf/PBMOutputDev.cc: * xpdf/PBMOutputDev.h: * xpdf/PDFDoc.cc: * xpdf/PDFDoc.h: * xpdf/PSOutputDev.cc: * xpdf/PSOutputDev.h: * xpdf/Page.cc: * xpdf/Page.h: * xpdf/Parser.cc: * xpdf/SFont.cc: * xpdf/SFont.h: * xpdf/Stream.cc: * xpdf/Stream.h: * xpdf/T1Font.cc: * xpdf/T1Font.h: * xpdf/TTFont.cc: * xpdf/TTFont.h: * xpdf/TextOutputDev.cc: * xpdf/TextOutputDev.h: * xpdf/XOutputDev.cc: * xpdf/XOutputDev.h: * xpdf/XPixmapOutputDev.cc: * xpdf/XPixmapOutputDev.h: * xpdf/XRef.cc: * xpdf/XRef.h: * xpdf/config.h: * xpdf/gpdf-control.cc: * xpdf/pdffonts.cc: * xpdf/pdfimages.cc: * xpdf/pdfinfo.cc: * xpdf/pdftopbm.cc: * xpdf/pdftops.cc: * xpdf/pdftotext.cc: * xpdf/tests/Makefile.am: * xpdf/vms_make.com: * xpdf/xpdf.cc: Imported Xpdf 3.00 and fixed build.
Diffstat (limited to 'pdf/xpdf/pdftops.cc')
-rw-r--r--pdf/xpdf/pdftops.cc81
1 files changed, 53 insertions, 28 deletions
diff --git a/pdf/xpdf/pdftops.cc b/pdf/xpdf/pdftops.cc
index 247e455..3042006 100644
--- a/pdf/xpdf/pdftops.cc
+++ b/pdf/xpdf/pdftops.cc
@@ -47,6 +47,10 @@ static GBool noEmbedCIDTTFonts = gFalse;
static char paperSize[15] = "";
static int paperWidth = 0;
static int paperHeight = 0;
+static GBool noCrop = gFalse;
+static GBool expand = gFalse;
+static GBool noShrink = gFalse;
+static GBool noCenter = gFalse;
static GBool duplex = gFalse;
static char ownerPassword[33] = "\001";
static char userPassword[33] = "\001";
@@ -56,63 +60,71 @@ static GBool printVersion = gFalse;
static GBool printHelp = gFalse;
static ArgDesc argDesc[] = {
- {"-f", argInt, &firstPage, 0,
+ {"-f", argInt, &firstPage, 0,
"first page to print"},
- {"-l", argInt, &lastPage, 0,
+ {"-l", argInt, &lastPage, 0,
"last page to print"},
- {"-level1", argFlag, &level1, 0,
+ {"-level1", argFlag, &level1, 0,
"generate Level 1 PostScript"},
- {"-level1sep", argFlag, &level1Sep, 0,
+ {"-level1sep", argFlag, &level1Sep, 0,
"generate Level 1 separable PostScript"},
- {"-level2", argFlag, &level2, 0,
+ {"-level2", argFlag, &level2, 0,
"generate Level 2 PostScript"},
- {"-level2sep", argFlag, &level2Sep, 0,
+ {"-level2sep", argFlag, &level2Sep, 0,
"generate Level 2 separable PostScript"},
- {"-level3", argFlag, &level3, 0,
+ {"-level3", argFlag, &level3, 0,
"generate Level 3 PostScript"},
- {"-level3sep", argFlag, &level3Sep, 0,
+ {"-level3sep", argFlag, &level3Sep, 0,
"generate Level 3 separable PostScript"},
- {"-eps", argFlag, &doEPS, 0,
+ {"-eps", argFlag, &doEPS, 0,
"generate Encapsulated PostScript (EPS)"},
- {"-form", argFlag, &doForm, 0,
+ {"-form", argFlag, &doForm, 0,
"generate a PostScript form"},
#if OPI_SUPPORT
- {"-opi", argFlag, &doOPI, 0,
+ {"-opi", argFlag, &doOPI, 0,
"generate OPI comments"},
#endif
- {"-noembt1", argFlag, &noEmbedT1Fonts, 0,
+ {"-noembt1", argFlag, &noEmbedT1Fonts, 0,
"don't embed Type 1 fonts"},
- {"-noembtt", argFlag, &noEmbedTTFonts, 0,
+ {"-noembtt", argFlag, &noEmbedTTFonts, 0,
"don't embed TrueType fonts"},
- {"-noembcidps", argFlag, &noEmbedCIDPSFonts, 0,
+ {"-noembcidps", argFlag, &noEmbedCIDPSFonts, 0,
"don't embed CID PostScript fonts"},
- {"-noembcidtt", argFlag, &noEmbedCIDTTFonts, 0,
+ {"-noembcidtt", argFlag, &noEmbedCIDTTFonts, 0,
"don't embed CID TrueType fonts"},
- {"-paper", argString, paperSize, sizeof(paperSize),
+ {"-paper", argString, paperSize, sizeof(paperSize),
"paper size (letter, legal, A4, A3, match)"},
- {"-paperw", argInt, &paperWidth, 0,
+ {"-paperw", argInt, &paperWidth, 0,
"paper width, in points"},
- {"-paperh", argInt, &paperHeight, 0,
+ {"-paperh", argInt, &paperHeight, 0,
"paper height, in points"},
- {"-duplex", argFlag, &duplex, 0,
+ {"-nocrop", argFlag, &noCrop, 0,
+ "don't crop pages to CropBox"},
+ {"-expand", argFlag, &expand, 0,
+ "expand pages smaller than the paper size"},
+ {"-noshrink", argFlag, &noShrink, 0,
+ "don't shrink pages larger than the paper size"},
+ {"-nocenter", argFlag, &noCenter, 0,
+ "don't center pages smaller than the paper size"},
+ {"-duplex", argFlag, &duplex, 0,
"enable duplex printing"},
- {"-opw", argString, ownerPassword, sizeof(ownerPassword),
+ {"-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),
"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}
};
@@ -192,6 +204,18 @@ int main(int argc, char *argv[]) {
globalParams->setPSPaperHeight(paperHeight);
}
}
+ if (noCrop) {
+ globalParams->setPSCrop(gFalse);
+ }
+ if (expand) {
+ globalParams->setPSExpandSmaller(gTrue);
+ }
+ if (noShrink) {
+ globalParams->setPSShrinkLarger(gFalse);
+ }
+ if (noCenter) {
+ globalParams->setPSCenter(gFalse);
+ }
if (duplex) {
globalParams->setPSDuplex(duplex);
}
@@ -281,7 +305,8 @@ int main(int argc, char *argv[]) {
psOut = new PSOutputDev(psFileName->getCString(), doc->getXRef(),
doc->getCatalog(), firstPage, lastPage, mode);
if (psOut->isOk()) {
- doc->displayPages(psOut, firstPage, lastPage, 72, 72, 0, gFalse);
+ doc->displayPages(psOut, firstPage, lastPage, 72, 72,
+ 0, globalParams->getPSCrop(), gFalse);
} else {
delete psOut;
exitCode = 2;