Bug 819 : PDF Export library does not work properly
Last modified: 2008-06-11 16:45




Status:
RESOLVED
Resolution:
INVALID -
Priority:
P2
Severity:
normal

 

Reporter:
enodren
Assigned To:
fry

Attachment Type Created Size Actions
PDF Export MousePress example screenshot 1 image/pjpeg 2008-06-11 11:19 813.24 KB
PDF Export MousePress example screenshot 2 image/pjpeg 2008-06-11 11:21 612.75 KB
code with pdf export bug text/plain 2008-06-11 16:07 957 bytes

Description:   Opened: 2008-06-11 07:15
1. 0135
2. Windows XP
3. Any example under Examples\Libraries\PDF Export:

/**
* Mouse Press.
*
* Saves one PDF of the contents of the display window
* each time the mouse is pressed.
*/


import processing.pdf.*;

boolean saveOneFrame = false;

void setup() {
size(600, 600);
frameRate(24);
}

void draw() {
if(saveOneFrame == true) {
beginRecord(PDF, "Line.pdf");
}

background(255);
stroke(0, 20);
strokeWeight(20.0);
line(mouseX, 0, width-mouseY, height);

if(saveOneFrame == true) {
endRecord();
saveOneFrame = false;
}
}

void mousePressed() {
saveOneFrame = true;
}


4. The PDF export library doesn't not properly render graphics to the screen, making
any PDF capture of an interactive work impossible. I've tested on multiple computers
and all exhibit this behavior.
Additional Comment #1 From fry 2008-06-11 08:38
that example works fine for me, though you seem to be alluding to problems
in your own code, not in the example. is that the case?
Additional Comment #2 From enodren 2008-06-11 11:19
edit]
PDF Export MousePress example screenshot 1

Screen shot showing the example while running (no line)
Additional Comment #3 From enodren 2008-06-11 11:21
(From update of edit])
screenshot showing the MousePress pdf library while running (no line)
Additional Comment #4 From enodren 2008-06-11 11:21
edit]
PDF Export MousePress example screenshot 2

screen shot showing the resulting pdf (faint line)
Additional Comment #5 From enodren 2008-06-11 16:07
edit]
code with pdf export bug

this is the file i'm working on... it draws as designed when import
processing.pdf.*; is commented out (3.jpg), otherwise it draws incorrectly
(4.jpg)
Additional Comment #6 From fry 2008-06-11 16:45
that's not a bug. beginRecord() does just that--it begins recording all
graphics commands to a file. there's no way for it to know what stroke and
fill you've set back in setup(). as soon as you call beginRecord(), you're
dealing with a fresh drawing surface.

we may change this someday, see bug #346, but it introduces a lot of
complexity so we have not so far.