Commit c3470145 authored by William Bader's avatar William Bader Committed by Albert Astals Cid

Add PS level1 non standard binary output option

More info at bug 34003
parent 37077aa4
......@@ -20,7 +20,7 @@
// Copyright (C) 2007 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
// Copyright (C) 2007, 2009 Jonathan Kew <jonathan_kew@sil.org>
// Copyright (C) 2009 Petr Gajdos <pgajdos@novell.com>
// Copyright (C) 2009 William Bader <williambader@hotmail.com>
// Copyright (C) 2009, 2011 William Bader <williambader@hotmail.com>
// Copyright (C) 2009 Kovid Goyal <kovid@kovidgoyal.net>
// Copyright (C) 2010 Hib Eris <hib@hiberis.nl>
// Copyright (C) 2010 Patrick Spendrin <ps_ml@gmx.de>
......@@ -665,6 +665,7 @@ GlobalParams::GlobalParams(const char *customPopplerDataDir)
psPreload = gFalse;
psOPI = gFalse;
psASCIIHex = gFalse;
psBinary = gFalse;
textEncoding = new GooString("UTF-8");
#if defined(_WIN32)
textEOL = eolDOS;
......@@ -1380,6 +1381,15 @@ GBool GlobalParams::getPSASCIIHex() {
return ah;
}
GBool GlobalParams::getPSBinary() {
GBool binary;
lockGlobalParams;
binary = psBinary;
unlockGlobalParams;
return binary;
}
GooString *GlobalParams::getTextEncodingName() {
GooString *s;
......@@ -1737,6 +1747,12 @@ void GlobalParams::setPSASCIIHex(GBool hex) {
unlockGlobalParams;
}
void GlobalParams::setPSBinary(GBool binary) {
lockGlobalParams;
psBinary = binary;
unlockGlobalParams;
}
void GlobalParams::setTextEncoding(char *encodingName) {
lockGlobalParams;
delete textEncoding;
......
......@@ -20,7 +20,7 @@
// Copyright (C) 2007 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
// Copyright (C) 2009 Jonathan Kew <jonathan_kew@sil.org>
// Copyright (C) 2009 Petr Gajdos <pgajdos@novell.com>
// Copyright (C) 2009 William Bader <williambader@hotmail.com>
// Copyright (C) 2009, 2011 William Bader <williambader@hotmail.com>
// Copyright (C) 2010 Hib Eris <hib@hiberis.nl>
//
// To see a description of the changes please see the Changelog file that
......@@ -199,6 +199,7 @@ public:
GBool getPSPreload();
GBool getPSOPI();
GBool getPSASCIIHex();
GBool getPSBinary();
GooString *getTextEncodingName();
EndOfLineKind getTextEOL();
GBool getTextPageBreaks();
......@@ -244,6 +245,7 @@ public:
void setPSPreload(GBool preload);
void setPSOPI(GBool opi);
void setPSASCIIHex(GBool hex);
void setPSBinary(GBool binary);
void setTextEncoding(char *encodingName);
GBool setTextEOL(char *s);
void setTextPageBreaks(GBool pageBreaks);
......@@ -325,6 +327,7 @@ private:
// memory
GBool psOPI; // generate PostScript OPI comments?
GBool psASCIIHex; // use ASCIIHex instead of ASCII85?
GBool psBinary; // use binary instead of hex
GooString *textEncoding; // encoding (unicodeMap) to use for text
// output
EndOfLineKind textEOL; // type of EOL marker to use for text
......
This diff is collapsed.
......@@ -95,6 +95,13 @@ Generate OPI comments for all images and forms which have OPI
information. (This option is only available if pdftops was compiled
with OPI support.)
.TP
.B \-binary
Write binary data in Level 1 PostScript. By default, pdftops writes
hex-encoded data in Level 1 PostScript. Binary data is non-standard
in Level 1 PostScript but reduces the file size and can be useful
when Level 1 PostScript is required only for its restricted use
of PostScript operators.
.TP
.B \-noembt1
By default, any Type 1 fonts which are embedded in the PDF file are
copied into the PostScript file. This option causes pdftops to
......
......@@ -19,7 +19,7 @@
// Copyright (C) 2007-2008, 2010 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2009 Till Kamppeter <till.kamppeter@gmail.com>
// Copyright (C) 2009 Sanjoy Mahajan <sanjoy@mit.edu>
// Copyright (C) 2009 William Bader <williambader@hotmail.com>
// Copyright (C) 2009, 2011 William Bader <williambader@hotmail.com>
// Copyright (C) 2010 Hib Eris <hib@hiberis.nl>
//
// To see a description of the changes please see the Changelog file that
......@@ -85,6 +85,7 @@ static GBool doForm = gFalse;
#if OPI_SUPPORT
static GBool doOPI = gFalse;
#endif
static GBool psBinary = gFalse;
static GBool noEmbedT1Fonts = gFalse;
static GBool noEmbedTTFonts = gFalse;
static GBool noEmbedCIDPSFonts = gFalse;
......@@ -132,6 +133,8 @@ static const ArgDesc argDesc[] = {
{"-opi", argFlag, &doOPI, 0,
"generate OPI comments"},
#endif
{"-binary", argFlag, &psBinary, 0,
"write binary data in Level 1 PostScript"},
{"-noembt1", argFlag, &noEmbedT1Fonts, 0,
"don't embed Type 1 fonts"},
{"-noembtt", argFlag, &noEmbedTTFonts, 0,
......@@ -289,6 +292,9 @@ int main(int argc, char *argv[]) {
globalParams->setPSOPI(doOPI);
}
#endif
if (psBinary) {
globalParams->setPSBinary(psBinary);
}
if (quiet) {
globalParams->setErrQuiet(quiet);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment