Hey. While I was updating the NextText library, I came across a problem with the PDF recorder. As a work around to Procressing's limitations for rendering complex shapes (with holes), the NextText P2D renderer draws to a buffer PImage and then slaps that on the PApplet by calling image(...).
To make sure that this image does not cover previous drawn objects, its background is set to fully transparent. This works smoothly on screen. The simple code below shows a green background with a transparent white circle in the middle.
The problem comes with the exported PDF which seems to drop any kind of transparency. The exported PDF shows a white background with an opaque white circle.
Bug or something i'm missing?
Code:import processing.pdf.*;
PGraphics pg;
void setup() {
size(600, 400, P2D);
pg = createGraphics(width, height, JAVA2D);
pg.beginDraw();
pg.background(0x00ffffff);
pg.smooth();
pg.stroke(0);
pg.fill(255, 100);
pg.ellipse(width/2, height/2, 25, 25);
pg.endDraw();
noLoop();
}
void draw() {
beginRecord(PDF, "outitgoes.pdf");
background(30, 180, 40);
image(pg, 0, 0);
endRecord();
}