Max Gilead created FOP-2263:
-------------------------------

             Summary: PDFDocumentGraphics2D.closePage() should not nullify 
currentStream
                 Key: FOP-2263
                 URL: https://issues.apache.org/jira/browse/FOP-2263
             Project: Fop
          Issue Type: Improvement
          Components: pdf
    Affects Versions: 1.1
            Reporter: Max Gilead
            Priority: Minor


In version 1.1 the PDFDocumentGraphics2D.closePage() method nullifies 
currentStream in line 281:
        currentStream = null;

I suggest to remove this line.


Nullifying currentStream prevents the user from obtaining raw (not wrapped 
inside a PDF document) output using the PDFGraphics2D.getString() method. 
PDFGraphics2D.dispose() nullifies currentStream so there seems to be no reason 
for .closePage() to do the same.


Current workaround is to create a new PDFDocumentGraphics2D instance like this:

g = new PDFDocumentGraphics2D(false, out, w, h) {
    @Override protected void closePage() {
        content = super.getString() + "Q\n";
        super.closePage();
    }
};

which works (and proves the data is there) but is, quite obviously, ugly and 
fragile.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to