I'm not sure what this quickdraw thing is you're referring to, but if I'm understanding it right, it's not like you can alter the PDF heading after the transform. The PDF is already mostly written to the file at this point. It just left out the last block. I don't know the size of that block, if it's always one complete section, if it's possible to insert something to the file before that. Obviously you can't write anything after the end of that stream before closing the stream because it's a PDF which has to end with the %EOF.
As long as I get the same results, it makes more sense to use a ByteArrayOutputStream so I can pass along the output to any destination. As I explained this can be used to generate a PDF or a printout. Also the program is running on the server, so after I execute the toByteArray to get the output from the stream, I can clone those bytes to the client to either generate the output as a PDF directly on a client machine (through webstart) or I can pass it into the preview panel object. -----Original Message----- From: paul womack [mailto:[email protected]] Sent: Wednesday, August 25, 2010 10:40 AM To: [email protected] Subject: Re: Invalid PDF Created Eric Douglas wrote: > Surely this is a longer explanation than you're asking for. Certainly was ;-) > The short > answer is I'm well aware of how the output streams work, but I thought > if the transform was writing to it which should be a complete process > that it would close it when it's done. It was your expressed surprise that an open BufferedOutputStream isn't flushed that I was commenting on. As in: > Eric Douglas wrote: >> I resolved this. After the transform I didn't close the output stream. > Apparently that left some bytes hanging. It appears that the (real) surprise is that the execution doesn't close its destination OutputStream. I would be surprised if it *did*. Consider, for example, that for reasons all-my-own I want to create an old style quickdraw version from fop input. If I had a quickdraw writing library, I could generate a quickdraw image header (*), let FOP write a (rendered) jpeg to the still-open OutputStream of the quickdraw, and then generate any required quickdraw trailer. It would be most inconvenient if the FOP staged closed my outputstream. BugBear (* this isn't how the quickdraw really works, but it's near enough for this example) --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
