Commit a5257efe authored by Fabio D'Urso's avatar Fabio D'Urso Committed by Albert Astals Cid

Re-added forceRasterize to PSOutputDev (and qt4 fix too)‏

The patch restores the forceRasterize argument in PSOutputDev ctors.
Commit 6ee907f2 had removed it, turning it
into a global param.
As a side effect, this patch also fixes qt4/poppler-ps-converter, which had
not been updated to the new signature, and thus produced corrupted output if
forceRasterization was set.
parent 55d039ad
......@@ -1065,7 +1065,7 @@ poppler_page_render_to_ps (PopplerPage *page,
ps_file->first_page, ps_file->last_page,
psModePS, (int)ps_file->paper_width,
(int)ps_file->paper_height, ps_file->duplex,
0, 0, 0, 0, gFalse);
0, 0, 0, 0, gFalse, gFalse);
ps_file->document->doc->displayPage (ps_file->out, page->index + 1, 72.0, 72.0,
......
......@@ -588,7 +588,6 @@ GlobalParams::GlobalParams(const char *customPopplerDataDir)
psUncompressPreloadedImages = gFalse;
psRasterResolution = 300;
psRasterMono = gFalse;
psAlwaysRasterize = gFalse;
textEncoding = new GooString("UTF-8");
#if defined(_WIN32)
textEOL = eolDOS;
......@@ -1618,15 +1617,6 @@ GBool GlobalParams::getPSRasterMono() {
return mono;
}
GBool GlobalParams::getPSAlwaysRasterize() {
GBool rast;
lockGlobalParams;
rast = psAlwaysRasterize;
unlockGlobalParams;
return rast;
}
GooString *GlobalParams::getTextEncodingName() {
GooString *s;
......@@ -2016,12 +2006,6 @@ void GlobalParams::setPSRasterMono(GBool mono) {
unlockGlobalParams;
}
void GlobalParams::setPSAlwaysRasterize(GBool always) {
lockGlobalParams;
psAlwaysRasterize = always;
unlockGlobalParams;
}
void GlobalParams::setTextEncoding(char *encodingName) {
lockGlobalParams;
delete textEncoding;
......
......@@ -170,7 +170,6 @@ public:
GBool getPSUncompressPreloadedImages();
double getPSRasterResolution();
GBool getPSRasterMono();
GBool getPSAlwaysRasterize();
GooString *getTextEncodingName();
EndOfLineKind getTextEOL();
GBool getTextPageBreaks();
......@@ -225,7 +224,6 @@ public:
void setPSUncompressPreloadedImages(GBool uncomp);
void setPSRasterResolution(double res);
void setPSRasterMono(GBool mono);
void setPSAlwaysRasterize(GBool always);
void setTextEncoding(char *encodingName);
GBool setTextEOL(char *s);
void setTextPageBreaks(GBool pageBreaks);
......@@ -327,7 +325,6 @@ private:
GBool psRasterMono; // true to do PostScript rasterization
// in monochrome (gray); false to do it
// in color (RGB/CMYK)
GBool psAlwaysRasterize; // force PostScript rasterization
GooString *textEncoding; // encoding (unicodeMap) to use for text
// output
EndOfLineKind textEOL; // type of EOL marker to use for text
......
......@@ -1052,6 +1052,7 @@ PSOutputDev::PSOutputDev(const char *fileName, PDFDoc *doc,
int firstPage, int lastPage, PSOutMode modeA,
int paperWidthA, int paperHeightA, GBool duplexA,
int imgLLXA, int imgLLYA, int imgURXA, int imgURYA,
GBool forceRasterizeA,
GBool manualCtrlA,
PSOutCustomCodeCbk customCodeCbkA,
void *customCodeCbkDataA) {
......@@ -1078,6 +1079,7 @@ PSOutputDev::PSOutputDev(const char *fileName, PDFDoc *doc,
customColors = NULL;
haveTextClip = gFalse;
t3String = NULL;
forceRasterize = forceRasterizeA;
// open file or pipe
if (!strcmp(fileName, "-")) {
......@@ -1120,6 +1122,7 @@ PSOutputDev::PSOutputDev(PSOutputFunc outputFuncA, void *outputStreamA,
int firstPage, int lastPage, PSOutMode modeA,
int paperWidthA, int paperHeightA, GBool duplexA,
int imgLLXA, int imgLLYA, int imgURXA, int imgURYA,
GBool forceRasterizeA,
GBool manualCtrlA,
PSOutCustomCodeCbk customCodeCbkA,
void *customCodeCbkDataA) {
......@@ -1143,6 +1146,7 @@ PSOutputDev::PSOutputDev(PSOutputFunc outputFuncA, void *outputStreamA,
customColors = NULL;
haveTextClip = gFalse;
t3String = NULL;
forceRasterize = forceRasterizeA;
init(outputFuncA, outputStreamA, psGeneric, psTitle,
doc, firstPage, lastPage, modeA,
......@@ -3055,7 +3059,7 @@ GBool PSOutputDev::checkPageSlice(Page *page, double /*hDPI*/, double /*vDPI*/,
GBool useBinary;
GBool isGray;
if (globalParams->getPSAlwaysRasterize()) {
if (forceRasterize) {
rasterize = gTrue;
} else {
scan = new PreScanOutputDev(doc);
......
......@@ -98,6 +98,7 @@ public:
GBool duplexA = gTrue,
int imgLLXA = 0, int imgLLYA = 0,
int imgURXA = 0, int imgURYA = 0,
GBool forceRasterizeA = gFalse,
GBool manualCtrlA = gFalse,
PSOutCustomCodeCbk customCodeCbkA = NULL,
void *customCodeCbkDataA = NULL);
......@@ -111,6 +112,7 @@ public:
GBool duplexA = gTrue,
int imgLLXA = 0, int imgLLYA = 0,
int imgURXA = 0, int imgURYA = 0,
GBool forceRasterizeA = gFalse,
GBool manualCtrlA = gFalse,
PSOutCustomCodeCbk customCodeCbkA = NULL,
void *customCodeCbkDataA = NULL);
......@@ -474,6 +476,7 @@ private:
GBool t3FillColorOnly; // operators should only use the fill color
GBool t3Cacheable; // cleared if char is not cacheable
GBool t3NeedsRestore; // set if a 'q' operator was issued
GBool forceRasterize; // forces the page to be rasterized into a image before printing
GBool displayText; // displayText
#if OPI_SUPPORT
......
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