Sfoglia il codice sorgente

Bugzilla #46882:

Fixed the handling of CMYK colors in PDFGraphics2D.
Suggested by: Yegor Kozlov <yegor.at.dinom.ru>

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@757338 13f79535-47bb-0310-9956-ffa450edef68
tags/fop-1_0
Jeremias Maerki 15 anni fa
parent
commit
a384002ccf
2 ha cambiato i file con 13 aggiunte e 14 eliminazioni
  1. 10
    14
      src/java/org/apache/fop/svg/PDFGraphics2D.java
  2. 3
    0
      status.xml

+ 10
- 14
src/java/org/apache/fop/svg/PDFGraphics2D.java Vedi File

@@ -59,6 +59,15 @@ import org.apache.batik.ext.awt.RadialGradientPaint;
import org.apache.batik.ext.awt.RenderingHintsKeyExt;
import org.apache.batik.gvt.GraphicsNode;
import org.apache.batik.gvt.PatternPaint;

import org.apache.xmlgraphics.image.loader.ImageInfo;
import org.apache.xmlgraphics.image.loader.ImageSize;
import org.apache.xmlgraphics.image.loader.impl.ImageRawCCITTFax;
import org.apache.xmlgraphics.image.loader.impl.ImageRawJPEG;
import org.apache.xmlgraphics.image.loader.impl.ImageRendered;
import org.apache.xmlgraphics.java2d.AbstractGraphics2D;
import org.apache.xmlgraphics.java2d.GraphicContext;

import org.apache.fop.fonts.Font;
import org.apache.fop.fonts.FontInfo;
import org.apache.fop.fonts.FontSetup;
@@ -83,13 +92,6 @@ import org.apache.fop.render.pdf.ImageRawCCITTFaxAdapter;
import org.apache.fop.render.pdf.ImageRawJPEGAdapter;
import org.apache.fop.render.pdf.ImageRenderedAdapter;
import org.apache.fop.util.ColorExt;
import org.apache.xmlgraphics.image.loader.ImageInfo;
import org.apache.xmlgraphics.image.loader.ImageSize;
import org.apache.xmlgraphics.image.loader.impl.ImageRawCCITTFax;
import org.apache.xmlgraphics.image.loader.impl.ImageRawJPEG;
import org.apache.xmlgraphics.image.loader.impl.ImageRendered;
import org.apache.xmlgraphics.java2d.AbstractGraphics2D;
import org.apache.xmlgraphics.java2d.GraphicContext;

/**
* PDF Graphics 2D.
@@ -741,13 +743,7 @@ public class PDFGraphics2D extends AbstractGraphics2D implements NativeImageHand
throw new PDFConformanceException(
"PDF/A-1 does not allow mixing DeviceRGB and DeviceCMYK.");
}
float[] cComps = c.getColorComponents(new float[3]);
double[] cmyk = new double[3];
for (int i = 0; i < 3; i++) {
// convert the float elements to doubles for pdf
cmyk[i] = cComps[i];
}
PDFColor currentColour = new PDFColor(cmyk[0], cmyk[1], cmyk[2], cmyk[3]);
PDFColor currentColour = new PDFColor(c);
currentStream.write(currentColour.getColorSpaceOut(fill));
} else if (c.getColorSpace().getType()
== ColorSpace.TYPE_2CLR) {

+ 3
- 0
status.xml Vedi File

@@ -58,6 +58,9 @@
documents. Example: the fix of marks layering will be such a case when it's done.
-->
<release version="FOP Trunk" date="TBD">
<action context="Renderers" dev="JM" type="fix" fixes-bug="46882" due-to="Yegor Kozlov">
Fixed the handling of CMYK colors in PDFGraphics2D.
</action>
<action context="Layout" dev="AD" type="fix" fixes-bug="46489">
Fixed a bug when combining a forced break with a "last" page-master. The restart
of the algorithm would start at the index of the penalty corresponding to the last

Loading…
Annulla
Salva