xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Max Gilead (JIRA)" <j...@apache.org>
Subject [jira] [Created] (FOP-2263) PDFDocumentGraphics2D.closePage() should not nullify currentStream
Date Fri, 07 Jun 2013 11:40:21 GMT
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
        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";

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

View raw message