--- poppler-git-02feb11-splashdpi/poppler/GlobalParams.cc- 2011-02-02 06:40:53.000000000 +0100 +++ poppler-git-02feb11-splashdpi/poppler/GlobalParams.cc 2011-02-04 01:19:33.865803478 +0100 @@ -20,7 +20,7 @@ // Copyright (C) 2007 Krzysztof Kowalczyk // Copyright (C) 2007, 2009 Jonathan Kew // Copyright (C) 2009 Petr Gajdos -// Copyright (C) 2009 William Bader +// Copyright (C) 2009,2011 William Bader // Copyright (C) 2009 Kovid Goyal // Copyright (C) 2010 Hib Eris // Copyright (C) 2010 Patrick Spendrin @@ -691,6 +691,7 @@ printCommands = gFalse; profileCommands = gFalse; errQuiet = gFalse; + splashResolution = 0.0; cidToUnicodeCache = new CharCodeToUnicodeCache(cidToUnicodeCacheSize); unicodeToUnicodeCache = @@ -1573,6 +1574,14 @@ return errQuiet; } +double GlobalParams::getSplashResolution() { + double r; + lockGlobalParams; + r = splashResolution; + unlockGlobalParams; + return r; +} + CharCodeToUnicode *GlobalParams::getCIDToUnicode(GooString *collection) { GooString *fileName; CharCodeToUnicode *ctu; @@ -1879,6 +1888,12 @@ unlockGlobalParams; } +void GlobalParams::setSplashResolution(double SplashResolutionA) { + lockGlobalParams; + splashResolution = SplashResolutionA; + unlockGlobalParams; +} + void GlobalParams::addSecurityHandler(XpdfSecurityHandler *handler) { #ifdef ENABLE_PLUGINS lockGlobalParams; --- poppler-git-02feb11-splashdpi/poppler/GlobalParams.h- 2011-02-02 06:40:53.824425591 +0100 +++ poppler-git-02feb11-splashdpi/poppler/GlobalParams.h 2011-02-04 01:19:43.891808611 +0100 @@ -20,7 +20,7 @@ // Copyright (C) 2007 Krzysztof Kowalczyk // Copyright (C) 2009 Jonathan Kew // Copyright (C) 2009 Petr Gajdos -// Copyright (C) 2009 William Bader +// Copyright (C) 2009, 2011 William Bader // Copyright (C) 2010 Hib Eris // // To see a description of the changes please see the Changelog file that @@ -219,6 +219,7 @@ GBool getPrintCommands(); GBool getProfileCommands(); GBool getErrQuiet(); + double getSplashResolution(); CharCodeToUnicode *getCIDToUnicode(GooString *collection); CharCodeToUnicode *getUnicodeToUnicode(GooString *fontName); @@ -263,6 +264,7 @@ void setPrintCommands(GBool printCommandsA); void setProfileCommands(GBool profileCommandsA); void setErrQuiet(GBool errQuietA); + void setSplashResolution(double splashResolutionA); //----- security handlers @@ -347,6 +349,7 @@ GBool printCommands; // print the drawing commands GBool profileCommands; // profile the drawing commands GBool errQuiet; // suppress error messages? + double splashResolution; // resolution when rasterizing images CharCodeToUnicodeCache *cidToUnicodeCache; CharCodeToUnicodeCache *unicodeToUnicodeCache; --- poppler-git-02feb11-splashdpi/poppler/PSOutputDev.cc- 2011-02-04 01:39:33.960467636 +0100 +++ poppler-git-02feb11-splashdpi/poppler/PSOutputDev.cc 2011-02-04 01:39:35.080469847 +0100 @@ -85,7 +85,7 @@ //------------------------------------------------------------------------ // Resolution at which pages with transparency will be rasterized. -#define splashDPI 300 +#define defaultSplashDPI 300 //------------------------------------------------------------------------ // PostScript prolog and setup @@ -2969,6 +2969,7 @@ Guchar col[4]; double m0, m1, m2, m3, m4, m5; int c, w, h, x, y, comp, i; + double splashDPI; char hexBuf[32*2 + 2]; // 32 values X 2 chars/value + line ending + null Guchar digit; @@ -3007,6 +3008,10 @@ paperColor, gTrue, gFalse); } splashOut->startDoc(xref); + splashDPI = globalParams->getSplashResolution(); + if (splashDPI < 1.0) { + splashDPI = defaultSplashDPI; + } page->displaySlice(splashOut, splashDPI, splashDPI, rotateA, useMediaBox, crop, sliceX, sliceY, sliceW, sliceH, --- poppler-git-02feb11-splashdpi/utils/pdftops.1- 2011-02-02 06:40:53.000000000 +0100 +++ poppler-git-02feb11-splashdpi/utils/pdftops.1 2011-02-07 23:43:44.923358601 +0100 @@ -95,6 +95,12 @@ information. (This option is only available if pdftops was compiled with OPI support.) .TP +.BI \-r " number" +Set the resolution in DPI when pdftops rasterizes images with +transparencies or, for Level 1 PostScript, when pdftops +rasterizes images with color masks. +By default, pdftops rasterizes images to 300 DPI. +.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 --- poppler-git-02feb11-splashdpi/utils/pdftops.cc- 2011-02-02 06:40:53.000000000 +0100 +++ poppler-git-02feb11-splashdpi/utils/pdftops.cc 2011-02-07 23:38:56.120539890 +0100 @@ -19,7 +19,7 @@ // Copyright (C) 2007-2008, 2010 Albert Astals Cid // Copyright (C) 2009 Till Kamppeter // Copyright (C) 2009 Sanjoy Mahajan -// Copyright (C) 2009 William Bader +// Copyright (C) 2009,2011 William Bader // Copyright (C) 2010 Hib Eris // // To see a description of the changes please see the Changelog file that @@ -85,6 +85,7 @@ #if OPI_SUPPORT static GBool doOPI = gFalse; #endif +static int splashResolution = 0; static GBool noEmbedT1Fonts = gFalse; static GBool noEmbedTTFonts = gFalse; static GBool noEmbedCIDPSFonts = gFalse; @@ -132,6 +133,8 @@ {"-opi", argFlag, &doOPI, 0, "generate OPI comments"}, #endif + {"-r", argInt, &splashResolution, 0, + "resolution for rasterization, in DPI (default is 300)"}, {"-noembt1", argFlag, &noEmbedT1Fonts, 0, "don't embed Type 1 fonts"}, {"-noembtt", argFlag, &noEmbedTTFonts, 0, @@ -266,6 +269,9 @@ if (level1 || level1Sep || level2 || level2Sep || level3 || level3Sep) { globalParams->setPSLevel(level); } + if (splashResolution > 0) { + globalParams->setSplashResolution(splashResolution); + } if (noEmbedT1Fonts) { globalParams->setPSEmbedType1(!noEmbedT1Fonts); }