|
237 | 237 | \newif\ifgraphicscache@trim |
238 | 238 | \newif\ifgraphicscache@clip |
239 | 239 | \newif\ifgraphicscache@fullclip |
| 240 | +\newif\ifgraphicscache@flatten\graphicscache@flattenfalse |
| 241 | +\newif\ifgraphicscache@cmyk\graphicscache@cmykfalse |
240 | 242 | \def\graphicscache@graphicsargs{} |
241 | 243 | \newlength\graphicscache@tmplen |
242 | 244 | \newcommand{\graphicscache@addarg}[1]{% |
|
268 | 270 | % \end{macrocode} |
269 | 271 | % \begin{macrocode} |
270 | 272 | compress/.is choice, |
271 | | - compress/false/.code={\graphicscache@compressfalse}, |
| 273 | + compress/false/.code={\graphicscache@compressfalse \def\graphicscache@compress@mode{off}}, |
272 | 274 | compress/jpeg/.code={\graphicscache@compresstrue \def\graphicscache@compress@mode{DCTEncode}}, |
273 | | - compress/flat/.code={\graphicscache@compresstrue \def\graphicscache@compress@mode{FlatEncode}}, |
| 275 | + compress/flat/.code={\graphicscache@compresstrue \def\graphicscache@compress@mode{FlateEncode}}, |
| 276 | + compress/flate/.code={\graphicscache@compresstrue \def\graphicscache@compress@mode{FlateEncode}}, |
274 | 277 | compress=jpeg, |
275 | 278 | % \end{macrocode} |
276 | 279 | % \begin{macrocode} |
277 | 280 | dpi/.store in=\graphicscache@dpi, |
278 | 281 | dpi=300, |
279 | 282 | % \end{macrocode} |
| 283 | +% \begin{macrocode} |
| 284 | + flatten/.is if=graphicscache@flatten, |
| 285 | + cmyk/.is if=graphicscache@cmyk, |
| 286 | +% \end{macrocode} |
280 | 287 | % \begin{macrocode} |
281 | 288 | qfactor/.store in=\graphicscache@qfactor, |
282 | 289 | qfactor={0.15}, |
|
375 | 382 | % This macro calls ghostscript using the name specified in the first argument. |
376 | 383 | % \begin{macrocode} |
377 | 384 | \newcommand{\graphicscache@callgswithname}[1]{% |
| 385 | + \ifgraphicscache@flatten |
| 386 | + \def\graphicscache@flattenarg{-dHaveTransparency=false}% |
| 387 | + \else |
| 388 | + \def\graphicscache@flattenarg{}% |
| 389 | + \fi |
| 390 | + \ifgraphicscache@cmyk |
| 391 | + \def\graphicscache@cmykarg{% |
| 392 | + -sProcessColorModel=DeviceCMYK |
| 393 | + -sColorConversionStrategy=CMYK |
| 394 | + -sColorConversionStrategyForImages=CMYK |
| 395 | + }% |
| 396 | + \else |
| 397 | + \def\graphicscache@cmykarg{}% |
| 398 | + \fi |
378 | 399 | \ifwindows |
379 | 400 | \graphicscache@ShellEscape{#1 |
380 | 401 | -sOutputFile=\graphicscache@output\space |
381 | 402 | -sDEVICE=pdfwrite |
382 | 403 | -dCompatibilityLevel=1.4 |
383 | 404 | -dPDFSETTINGS=/prepress |
384 | 405 | -dNOPAUSE -dQUIET -dBATCH |
| 406 | + \graphicscache@flattenarg \graphicscache@cmykarg |
385 | 407 | -c "<< |
386 | 408 | /AutoFilterColorImages false |
387 | 409 | /EncodeColorImages true |
|
403 | 425 | -dCompatibilityLevel=1.4 |
404 | 426 | -dPDFSETTINGS=/prepress |
405 | 427 | -dNOPAUSE -dQUIET -dBATCH |
| 428 | + \graphicscache@flattenarg \graphicscache@cmykarg |
406 | 429 | -c '<< |
407 | 430 | /AutoFilterColorImages false |
408 | 431 | /EncodeColorImages true |
|
724 | 747 | \else |
725 | 748 | \def\graphicscache@clipmode{nclip}% |
726 | 749 | \fi |
727 | | - \edef\graphicscache@outputhash{\pdf@mdfivesum{\graphicscache@options\graphicscache@graphicsargs\graphicscache@clipmode\graphicscache@hashedname}}% |
| 750 | + \ifgraphicscache@flatten |
| 751 | + \edef\graphicscache@clipmode{\graphicscache@clipmode{}flat}% |
| 752 | + \fi |
| 753 | + \ifgraphicscache@cmyk |
| 754 | + \edef\graphicscache@clipmode{\graphicscache@clipmode{}cmyk}% |
| 755 | + \fi |
| 756 | + \edef\graphicscache@outputhash{\pdf@mdfivesum{\graphicscache@options\graphicscache@graphicsargs\graphicscache@clipmode\graphicscache@compress@mode\graphicscache@hashedname}}% |
728 | 757 | \edef\graphicscache@output{\graphicscache@cachedir/\graphicscache@outputhash.pdf}% |
729 | 758 | \ifgraphicscache@listing |
730 | 759 | \PackageInfo{graphicscache}{graphicscache: includegraphics\{#2\} => \graphicscache@output}% |
|
0 commit comments