Details
Description
Gradient created in illustrator with stepping to color with opacity do not render properly in PDFBox.
Rectangle below sh added to test proper rendering.
PDF (v 1.5, Adobe Illustrator CS5.1):
http://u2.home.pl/gradients2.pdf
Correct rendering (using pdf.js):
http://u2.home.pl/correctrender.png
PDFBox rendering (using PdfRenderer.renderImageWithDPI):
http://u2.home.pl/pdfboxresult.png
What I noticed is that pdf.js have two sh operands during parsing, when PDFBox returns one via PDFGraphicsStreamEngine.
Tested on 2.0.2 and 1.8.12.
Code used to generate pdfboxresult.png:
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.rendering.ImageType;
import org.apache.pdfbox.rendering.PDFRenderer;
import org.apache.pdfbox.tools.imageio.ImageIOUtil;
import java.awt.image.BufferedImage;
import java.io.*;
public class Test {
public static void main(String[] args) throws IOException {
PDDocument document = PDDocument.load(new File("gradients2.pdf"));
PDFRenderer pdfRenderer = new PDFRenderer(document);
for (int page = 0; page < document.getNumberOfPages(); ++page)
document.close();
}
}
Attachments
Issue Links
- is duplicated by
-
PDFBOX-3000 Transparency Group issues
- Closed