poppler/Gfx.cc | 14 +++++++------- poppler/GlobalParams.cc | 54 ------------------------------------------------------ poppler/GlobalParams.h | 14 +++----------- poppler/OutputDev.cc | 25 +++++++++++++++++++++++++ poppler/OutputDev.h | 35 +++++++++++++++++++++++------------ poppler/PSOutputDev.cc | 8 ++++---- poppler/PSOutputDev.h | 2 +- poppler/SplashOutputDev.cc | 50 +++++++++++++++++++------------------------------- poppler/SplashOutputDev.h | 9 ++------- utils/pdftoppm.cc | 22 ++++++++++++---------- utils/pdftops.cc | 26 +++++++++++++++++++++++++- 11 files changed, 121 insertions(+), 138 deletions(-) diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc index 6bf7ec5..b80b147 100644 --- a/poppler/Gfx.cc +++ b/poppler/Gfx.cc @@ -29,7 +29,7 @@ // Copyright (C) 2008 Hib Eris // Copyright (C) 2009 M Joonas Pihlaja // Copyright (C) 2009-2013 Thomas Freitag -// Copyright (C) 2009 William Bader +// Copyright (C) 2009, 2014 William Bader // Copyright (C) 2009, 2010 David Benjamin // Copyright (C) 2010 Nils Höglund // Copyright (C) 2010 Christian Feuersänger @@ -2390,9 +2390,9 @@ void Gfx::doShadingPatternFill(GfxShadingPattern *sPat, } #if 1 //~tmp: turn off anti-aliasing temporarily - GBool vaa = out->getVectorAntialias(); + GBool vaa = out->getCurrentVectorAntialias(); if (vaa) { - out->setVectorAntialias(gFalse); + out->setCurrentVectorAntialias(gFalse); } #endif @@ -2419,7 +2419,7 @@ void Gfx::doShadingPatternFill(GfxShadingPattern *sPat, #if 1 //~tmp: turn off anti-aliasing temporarily if (vaa) { - out->setVectorAntialias(gTrue); + out->setCurrentVectorAntialias(gTrue); } #endif @@ -2461,9 +2461,9 @@ void Gfx::opShFill(Object args[], int numArgs) { out->updateFillColorSpace(state); #if 1 //~tmp: turn off anti-aliasing temporarily - GBool vaa = out->getVectorAntialias(); + GBool vaa = out->getCurrentVectorAntialias(); if (vaa) { - out->setVectorAntialias(gFalse); + out->setCurrentVectorAntialias(gFalse); } #endif @@ -2490,7 +2490,7 @@ void Gfx::opShFill(Object args[], int numArgs) { #if 1 //~tmp: turn off anti-aliasing temporarily if (vaa) { - out->setVectorAntialias(gTrue); + out->setCurrentVectorAntialias(gTrue); } #endif diff --git a/poppler/GlobalParams.cc b/poppler/GlobalParams.cc index 3d88646..daa4a6c 100644 --- a/poppler/GlobalParams.cc +++ b/poppler/GlobalParams.cc @@ -620,9 +620,6 @@ GlobalParams::GlobalParams(const char *customPopplerDataDir) textPageBreaks = gTrue; textKeepTinyChars = gFalse; enableFreeType = gTrue; - antialias = gTrue; - vectorAntialias = gTrue; - antialiasPrinting = gFalse; strokeAdjust = gTrue; screenType = screenUnset; screenSize = -1; @@ -1701,33 +1698,6 @@ GBool GlobalParams::getEnableFreeType() { return f; } -GBool GlobalParams::getAntialias() { - GBool f; - - lockGlobalParams; - f = antialias; - unlockGlobalParams; - return f; -} - -GBool GlobalParams::getVectorAntialias() { - GBool f; - - lockGlobalParams; - f = vectorAntialias; - unlockGlobalParams; - return f; -} - -GBool GlobalParams::getAntialiasPrinting() { - GBool f; - - lockGlobalParams; - f = antialiasPrinting; - unlockGlobalParams; - return f; -} - GBool GlobalParams::getStrokeAdjust() { GBool f; @@ -2098,30 +2068,6 @@ GBool GlobalParams::setDisableFreeTypeHinting(char *s) { return ok; } -GBool GlobalParams::setAntialias(char *s) { - GBool ok; - - lockGlobalParams; - ok = parseYesNo2(s, &antialias); - unlockGlobalParams; - return ok; -} - -GBool GlobalParams::setVectorAntialias(char *s) { - GBool ok; - - lockGlobalParams; - ok = parseYesNo2(s, &vectorAntialias); - unlockGlobalParams; - return ok; -} - -void GlobalParams::setAntialiasPrinting(GBool anti) { - lockGlobalParams; - antialiasPrinting = anti; - unlockGlobalParams; -} - void GlobalParams::setStrokeAdjust(GBool adjust) { lockGlobalParams; diff --git a/poppler/GlobalParams.h b/poppler/GlobalParams.h index c33a802..af655a7 100644 --- a/poppler/GlobalParams.h +++ b/poppler/GlobalParams.h @@ -20,7 +20,7 @@ // Copyright (C) 2007 Krzysztof Kowalczyk // Copyright (C) 2009 Jonathan Kew // Copyright (C) 2009 Petr Gajdos -// Copyright (C) 2009, 2011, 2012 William Bader +// Copyright (C) 2009, 2011, 2012, 2014 William Bader // Copyright (C) 2010 Hib Eris // Copyright (C) 2011 Pino Toscano // Copyright (C) 2012 Adrian Johnson @@ -183,9 +183,6 @@ public: GBool getTextPageBreaks(); GBool getTextKeepTinyChars(); GBool getEnableFreeType(); - GBool getAntialias(); - GBool getVectorAntialias(); - GBool getAntialiasPrinting(); GBool getStrokeAdjust(); ScreenType getScreenType(); int getScreenSize(); @@ -238,9 +235,6 @@ public: void setTextKeepTinyChars(GBool keep); GBool setEnableFreeType(char *s); GBool setDisableFreeTypeHinting(char *s); - GBool setAntialias(char *s); - GBool setVectorAntialias(char *s); - void setAntialiasPrinting(GBool print); void setStrokeAdjust(GBool strokeAdjust); void setScreenType(ScreenType st); void setScreenSize(int size); @@ -256,6 +250,8 @@ public: void setProfileCommands(GBool profileCommandsA); void setErrQuiet(GBool errQuietA); + static GBool parseYesNo2(const char *token, GBool *flag); + //----- security handlers void addSecurityHandler(XpdfSecurityHandler *handler); @@ -264,7 +260,6 @@ public: private: void parseNameToUnicode(GooString *name); - GBool parseYesNo2(const char *token, GBool *flag); UnicodeMap *getUnicodeMap2(GooString *encodingName); void scanEncodingDirs(); @@ -342,9 +337,6 @@ private: GBool textKeepTinyChars; // keep all characters in text output GBool enableFreeType; // FreeType enable flag GBool disableFreeTypeHinting; // FreeType disable hinting flag - GBool antialias; // anti-aliasing enable flag - GBool vectorAntialias; // vector anti-aliasing enable flag - GBool antialiasPrinting; // allow anti-aliasing when printing GBool strokeAdjust; // stroke adjustment enable flag ScreenType screenType; // halftone screen type int screenSize; // screen matrix size diff --git a/poppler/OutputDev.cc b/poppler/OutputDev.cc index ee3cf5a..c1765c5 100644 --- a/poppler/OutputDev.cc +++ b/poppler/OutputDev.cc @@ -36,12 +36,27 @@ #include "Stream.h" #include "GfxState.h" #include "OutputDev.h" +#include "GlobalParams.h" #include "goo/GooHash.h" //------------------------------------------------------------------------ // OutputDev //------------------------------------------------------------------------ +OutputDev::OutputDev() +#ifdef USE_CMS + : iccColorSpaceCache(5) +#endif +{ + profileHash = NULL; + + allowAntialias = gTrue; + antialias = gTrue; + vectorAntialias = gTrue; + currentVectorAntialias = vectorAntialias; + antialiasPrinting = gFalse; +} + void OutputDev::setDefaultCTM(double *ctm) { int i; double det; @@ -199,3 +214,13 @@ PopplerCache *OutputDev::getIccColorSpaceCache() return &iccColorSpaceCache; } #endif + +GBool OutputDev::setAntialias(char *s) { + GBool ok = GlobalParams::parseYesNo2(s, &antialias); + return ok; +} + +GBool OutputDev::setVectorAntialias(char *s) { + GBool ok = GlobalParams::parseYesNo2(s, &vectorAntialias); + return ok; +} diff --git a/poppler/OutputDev.h b/poppler/OutputDev.h index e8a7a47..c75deb8 100644 --- a/poppler/OutputDev.h +++ b/poppler/OutputDev.h @@ -22,7 +22,7 @@ // Copyright (C) 2009, 2012, 2013 Albert Astals Cid // Copyright (C) 2010 Christian Feuersänger // Copyright (C) 2012 Fabio D'Urso -// Copyright (C) 2012 William Bader +// Copyright (C) 2012, 2014 William Bader // // To see a description of the changes please see the Changelog file that // came with your tarball or type make ChangeLog if you are building from git @@ -73,13 +73,7 @@ class OutputDev { public: // Constructor. - OutputDev() -#ifdef USE_CMS - : iccColorSpaceCache(5) -#endif - { - profileHash = NULL; - } + OutputDev(); // Destructor. virtual ~OutputDev() {} @@ -327,10 +321,21 @@ public: //----- links virtual void processLink(AnnotLink * /*link*/) {} -#if 1 //~tmp: turn off anti-aliasing temporarily - virtual GBool getVectorAntialias() { return gFalse; } - virtual void setVectorAntialias(GBool /*vaa*/) {} -#endif + //----- Anti-aliasing + GBool getAllowAntialias() { return allowAntialias; } + GBool getAntialias() { return antialias; } + GBool getVectorAntialias() { return vectorAntialias; } + GBool getCurrentVectorAntialias() { return currentVectorAntialias; } + GBool getAntialiasPrinting() { return antialiasPrinting; } + + GBool setAntialias(char *s); + GBool setVectorAntialias(char *s); + + void setAllowAntialias(GBool anti) { allowAntialias = anti; } + void setAntialias(GBool anti) { antialias = anti; } + void setVectorAntialias(GBool anti) { vectorAntialias = anti; } + void setCurrentVectorAntialias(GBool anti) { currentVectorAntialias = anti; } + void setAntialiasPrinting(GBool anti) { antialiasPrinting = anti; } #ifdef USE_CMS PopplerCache *getIccColorSpaceCache(); @@ -342,6 +347,12 @@ private: double defICTM[6]; // inverse of default CTM GooHash *profileHash; + GBool allowAntialias; // this device allows antialiasing; set false to disable all antialiasing + GBool antialias; // font antialiasing enable flag + GBool vectorAntialias; // vector antialiasing enable flag, original value + GBool currentVectorAntialias; // current vector antialiasing enable flag, current value to use + GBool antialiasPrinting; // allow antialiasing when printing + #ifdef USE_CMS PopplerCache iccColorSpaceCache; #endif diff --git a/poppler/PSOutputDev.cc b/poppler/PSOutputDev.cc index 149bb62..427f0f9 100644 --- a/poppler/PSOutputDev.cc +++ b/poppler/PSOutputDev.cc @@ -23,7 +23,7 @@ // Copyright (C) 2009-2013 Thomas Freitag // Copyright (C) 2009 Till Kamppeter // Copyright (C) 2009 Carlos Garcia Campos -// Copyright (C) 2009, 2011, 2012 William Bader +// Copyright (C) 2009, 2011, 2012, 2014 William Bader // Copyright (C) 2009 Kovid Goyal // Copyright (C) 2009-2011, 2013, 2014 Adrian Johnson // Copyright (C) 2012, 2014 Fabio D'Urso @@ -3195,7 +3195,7 @@ GBool PSOutputDev::checkPageSlice(Page *page, double /*hDPI*/, double /*vDPI*/, paperColor[0] = 0xff; splashOut = new SplashOutputDev(splashModeMono8, 1, gFalse, paperColor, gFalse, - globalParams->getAntialiasPrinting()); + getAntialiasPrinting()); #if SPLASH_CMYK } else if (level == psLevel1Sep || level == psLevel2Sep || level == psLevel3Sep || globalParams->getOverprintPreview()) { @@ -3203,14 +3203,14 @@ GBool PSOutputDev::checkPageSlice(Page *page, double /*hDPI*/, double /*vDPI*/, paperColor[0] = paperColor[1] = paperColor[2] = paperColor[3] = 0; splashOut = new SplashOutputDev(splashModeCMYK8, 1, gFalse, paperColor, gFalse, - globalParams->getAntialiasPrinting()); + getAntialiasPrinting()); #endif } else { numComps = 3; paperColor[0] = paperColor[1] = paperColor[2] = 0xff; splashOut = new SplashOutputDev(splashModeRGB8, 1, gFalse, paperColor, gFalse, - globalParams->getAntialiasPrinting()); + getAntialiasPrinting()); } splashOut->startDoc(doc); diff --git a/poppler/PSOutputDev.h b/poppler/PSOutputDev.h index f30204d..b684977 100644 --- a/poppler/PSOutputDev.h +++ b/poppler/PSOutputDev.h @@ -20,7 +20,7 @@ // Copyright (C) 2009-2013 Thomas Freitag // Copyright (C) 2009 Till Kamppeter // Copyright (C) 2009 Carlos Garcia Campos -// Copyright (C) 2009, 2011 William Bader +// Copyright (C) 2009, 2011, 2014 William Bader // Copyright (C) 2010 Hib Eris // Copyright (C) 2011, 2014 Adrian Johnson // Copyright (C) 2012 Fabio D'Urso diff --git a/poppler/SplashOutputDev.cc b/poppler/SplashOutputDev.cc index 0eaeb79..7d17acd 100644 --- a/poppler/SplashOutputDev.cc +++ b/poppler/SplashOutputDev.cc @@ -22,7 +22,7 @@ // Copyright (C) 2009 Petr Gajdos // Copyright (C) 2009-2014 Thomas Freitag // Copyright (C) 2009 Carlos Garcia Campos -// Copyright (C) 2009 William Bader +// Copyright (C) 2009, 2014 William Bader // Copyright (C) 2010 Patrick Spendrin // Copyright (C) 2010 Brian Cameron // Copyright (C) 2010 PaweÅ‚ Wiejacha @@ -1223,10 +1223,8 @@ SplashOutputDev::SplashOutputDev(SplashColorMode colorModeA, bitmapRowPad = bitmapRowPadA; bitmapTopDown = bitmapTopDownA; bitmapUpsideDown = gFalse; - allowAntialias = allowAntialiasA; - vectorAntialias = allowAntialias && - globalParams->getVectorAntialias() && - colorMode != splashModeMono1; + setAllowAntialias(allowAntialiasA); + resetCurrentVectorAntialias(); overprintPreview = overprintPreviewA; enableFreeTypeHinting = gFalse; enableSlightHinting = gFalse; @@ -1245,7 +1243,7 @@ SplashOutputDev::SplashOutputDev(SplashColorMode colorModeA, bitmap = new SplashBitmap(1, 1, bitmapRowPad, colorMode, colorMode != splashModeMono1, bitmapTopDown); - splash = new Splash(bitmap, vectorAntialias, &screenParams); + splash = new Splash(bitmap, getCurrentVectorAntialias(), &screenParams); splash->setMinLineWidth(globalParams->getMinLineWidth()); splash->setThinLineMode(thinLineMode); splash->clear(paperColor, 0); @@ -1347,8 +1345,8 @@ void SplashOutputDev::startDoc(PDFDoc *docA) { enableFreeTypeHinting, enableSlightHinting, #endif - allowAntialias && - globalParams->getAntialias() && + getAllowAntialias() && + getAntialias() && colorMode != splashModeMono1); for (i = 0; i < nT3Fonts; ++i) { delete t3FontCache[i]; @@ -1396,7 +1394,8 @@ void SplashOutputDev::startPage(int pageNum, GfxState *state, XRef *xrefA) { colorMode != splashModeMono1, bitmapTopDown); } } - splash = new Splash(bitmap, vectorAntialias, &screenParams); + resetCurrentVectorAntialias(); + splash = new Splash(bitmap, getCurrentVectorAntialias(), &screenParams); splash->setThinLineMode(thinLineMode); splash->setMinLineWidth(globalParams->getMinLineWidth()); if (state) { @@ -2595,7 +2594,7 @@ void SplashOutputDev::type3D1(GfxState *state, double wx, double wy, } else { bitmap = new SplashBitmap(t3Font->glyphW, t3Font->glyphH, 1, splashModeMono8, gFalse); - splash = new Splash(bitmap, vectorAntialias, + splash = new Splash(bitmap, getCurrentVectorAntialias(), t3GlyphStack->origSplash->getScreen()); color[0] = 0x00; splash->clear(color); @@ -2747,7 +2746,7 @@ void SplashOutputDev::setSoftMaskFromImageMask(GfxState *state, imgMaskData.y = 0; maskBitmap = new SplashBitmap(bitmap->getWidth(), bitmap->getHeight(), 1, splashModeMono8, gFalse); - maskSplash = new Splash(maskBitmap, vectorAntialias); + maskSplash = new Splash(maskBitmap, getCurrentVectorAntialias()); maskColor[0] = 0; maskSplash->clear(maskColor); maskColor[0] = 0xff; @@ -3624,7 +3623,7 @@ void SplashOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, } maskBitmap = new SplashBitmap(bitmap->getWidth(), bitmap->getHeight(), 1, splashModeMono8, gFalse); - maskSplash = new Splash(maskBitmap, vectorAntialias); + maskSplash = new Splash(maskBitmap, getCurrentVectorAntialias()); maskColor[0] = 0; maskSplash->clear(maskColor); maskSplash->drawImage(&imageSrc, &imgMaskData, splashModeMono8, gFalse, @@ -3851,7 +3850,7 @@ void SplashOutputDev::beginTransparencyGroup(GfxState *state, double *bbox, // create the temporary bitmap bitmap = new SplashBitmap(w, h, bitmapRowPad, colorMode, gTrue, bitmapTopDown, bitmap->getSeparationList()); - splash = new Splash(bitmap, vectorAntialias, + splash = new Splash(bitmap, getCurrentVectorAntialias(), transpGroup->origSplash->getScreen()); if (transpGroup->next != NULL && transpGroup->next->knockout) { fontEngine->setAA(gFalse); @@ -3962,7 +3961,7 @@ void SplashOutputDev::setSoftMask(GfxState *state, double *bbox, //~ need to correctly handle the case where no blending color //~ space is given if (transpGroupStack->blendingColorSpace) { - tSplash = new Splash(tBitmap, vectorAntialias, + tSplash = new Splash(tBitmap, getCurrentVectorAntialias(), transpGroupStack->origSplash->getScreen()); switch (tBitmap->getMode()) { case splashModeMono1: @@ -4109,17 +4108,6 @@ void SplashOutputDev::clearModRegion() { splash->clearModRegion(); } -#if 1 //~tmp: turn off anti-aliasing temporarily -GBool SplashOutputDev::getVectorAntialias() { - return splash->getVectorAntialias(); -} - -void SplashOutputDev::setVectorAntialias(GBool vaa) { - vectorAntialias = vaa; - splash->setVectorAntialias(vaa); -} -#endif - void SplashOutputDev::setFreeTypeHinting(GBool enable, GBool enableSlightHintingA) { enableFreeTypeHinting = enable; @@ -4340,11 +4328,11 @@ GBool SplashOutputDev::gouraudTriangleShadedFill(GfxState *state, GfxGouraudTria SplashGouraudColor *splashShading = new SplashGouraudPattern(bDirectColorTranslation, state, shading, colorMode); // restore vector antialias because we support it here if (shading->isParameterized()) { - GBool vaa = getVectorAntialias(); + GBool vaa = getCurrentVectorAntialias(); GBool retVal = gFalse; - setVectorAntialias(gTrue); + setCurrentVectorAntialias(gTrue); retVal = splash->gouraudTriangleShadedFill(splashShading); - setVectorAntialias(vaa); + setCurrentVectorAntialias(vaa); return retVal; } delete splashShading; @@ -4354,9 +4342,9 @@ GBool SplashOutputDev::gouraudTriangleShadedFill(GfxState *state, GfxGouraudTria GBool SplashOutputDev::univariateShadedFill(GfxState *state, SplashUnivariatePattern *pattern, double tMin, double tMax) { double xMin, yMin, xMax, yMax; SplashPath *path; - GBool vaa = getVectorAntialias(); + GBool vaa = getCurrentVectorAntialias(); // restore vector antialias because we support it here - setVectorAntialias(gTrue); + setCurrentVectorAntialias(gTrue); GBool retVal = gFalse; // get the clip region bbox @@ -4409,7 +4397,7 @@ GBool SplashOutputDev::univariateShadedFill(GfxState *state, SplashUnivariatePat state->getOverprintMode(), NULL); retVal = (splash->shadedFill(path, pattern->getShading()->getHasBBox(), pattern) == splashOk); state->clearPath(); - setVectorAntialias(vaa); + setCurrentVectorAntialias(vaa); delete path; return retVal; diff --git a/poppler/SplashOutputDev.h b/poppler/SplashOutputDev.h index efbb865..fc19f79 100644 --- a/poppler/SplashOutputDev.h +++ b/poppler/SplashOutputDev.h @@ -354,11 +354,6 @@ public: int getNestCount() { return nestCount; } -#if 1 //~tmp: turn off anti-aliasing temporarily - virtual GBool getVectorAntialias(); - virtual void setVectorAntialias(GBool vaa); -#endif - void setFreeTypeHinting(GBool enable, GBool enableSlightHinting); protected: @@ -390,14 +385,14 @@ private: static GBool tilingBitmapSrc(void *data, SplashColorPtr line, Guchar *alphaLine); + void resetCurrentVectorAntialias() { setCurrentVectorAntialias(getAllowAntialias() && getVectorAntialias() && colorMode != splashModeMono1); } + GBool keepAlphaChannel; // don't fill with paper color, keep alpha channel SplashColorMode colorMode; int bitmapRowPad; GBool bitmapTopDown; GBool bitmapUpsideDown; - GBool allowAntialias; - GBool vectorAntialias; GBool overprintPreview; GBool enableFreeTypeHinting; GBool enableSlightHinting; diff --git a/utils/pdftoppm.cc b/utils/pdftoppm.cc index 962860b..3cebe82 100644 --- a/utils/pdftoppm.cc +++ b/utils/pdftoppm.cc @@ -363,16 +363,6 @@ int main(int argc, char *argv[]) { fprintf(stderr, "Bad '-freetype' value on command line\n"); } } - if (antialiasStr[0]) { - if (!globalParams->setAntialias(antialiasStr)) { - fprintf(stderr, "Bad '-aa' value on command line\n"); - } - } - if (vectorAntialiasStr[0]) { - if (!globalParams->setVectorAntialias(vectorAntialiasStr)) { - fprintf(stderr, "Bad '-aaVector' value on command line\n"); - } - } if (thinLineModeStr[0]) { if (strcmp(thinLineModeStr, "solid") == 0) { thinLineMode = splashThinLineSolid; @@ -465,6 +455,18 @@ int main(int argc, char *argv[]) { #endif splashModeRGB8, 4, gFalse, paperColor, gTrue, gTrue, thinLineMode); + + if (antialiasStr[0]) { + if (!splashOut->setAntialias(antialiasStr)) { + fprintf(stderr, "Bad '-aa' value on command line\n"); + } + } + if (vectorAntialiasStr[0]) { + if (!splashOut->setVectorAntialias(vectorAntialiasStr)) { + fprintf(stderr, "Bad '-aaVector' value on command line\n"); + } + } + splashOut->startDoc(doc); #endif // UTILS_USE_PTHREADS diff --git a/utils/pdftops.cc b/utils/pdftops.cc index babebed..47d3b55 100644 --- a/utils/pdftops.cc +++ b/utils/pdftops.cc @@ -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, 2011, 2012 William Bader +// Copyright (C) 2009, 2011, 2012, 2014 William Bader // Copyright (C) 2010 Hib Eris // Copyright (C) 2012 Thomas Freitag // Copyright (C) 2013 Suzuki Toshiya @@ -95,6 +95,8 @@ static GBool noEmbedTTFonts = gFalse; static GBool noEmbedCIDPSFonts = gFalse; static GBool noEmbedCIDTTFonts = gFalse; static GBool fontPassthrough = gFalse; +static char antialiasStr[16] = ""; +static char vectorAntialiasStr[16] = ""; static GBool preload = gFalse; static char paperSize[15] = ""; static int paperWidth = -1; @@ -154,6 +156,10 @@ static const ArgDesc argDesc[] = { "don't embed CID TrueType fonts"}, {"-passfonts", argFlag, &fontPassthrough,0, "don't substitute missing fonts"}, + {"-aa", argString, antialiasStr, sizeof(antialiasStr), + "enable font anti-aliasing: yes, no"}, + {"-aaVector", argString, vectorAntialiasStr, sizeof(vectorAntialiasStr), + "enable vector anti-aliasing: yes, no"}, {"-preload", argFlag, &preload, 0, "preload images and forms"}, {"-paper", argString, paperSize, sizeof(paperSize), @@ -407,6 +413,24 @@ int main(int argc, char *argv[]) { paperHeight, noCrop, duplex); + + if (antialiasStr[0]) { + if (!psOut->setAntialias(antialiasStr)) { + fprintf(stderr, "Bad '-aa' value on command line\n"); + } + if (psOut->getAntialias()) { + psOut->setAntialiasPrinting(gTrue); + } + } + if (vectorAntialiasStr[0]) { + if (!psOut->setVectorAntialias(vectorAntialiasStr)) { + fprintf(stderr, "Bad '-aaVector' value on command line\n"); + } + if (psOut->getVectorAntialias()) { + psOut->setAntialiasPrinting(gTrue); + } + } + if (psOut->isOk()) { doc->displayPages(psOut, firstPage, lastPage, 72, 72, 0, noCrop, !noCrop, gTrue);