Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
using iwpt_set_ostream_data() with BINARY info
erkel
Hi all,
I am creating a PT that will generate a PDF file (by taking the XML and passing it to Apache FOP along with an XSL sheet to generate a PDF) using lots of custom Perl.
Anyway, I have successfully created the PDF file, and now I want to insert the contents of that file (which is binary) back into the ostream.
I have previously been able to insert <i>strings</i> into the ostrem using <b>iwpt_set_ostream_data($ostream, $string);</b> but so far haven't been able to insert the <i>binary</i> PDF data into it... its empty.
My process is this:
1. User chooses to generate file thus calling the PT.
2. DCR is processed by the PT, the ostream is captured and written out to a temporary file.
3. FOP is called on that temporary file and a PDF is created.
4. That file is then opened in binmode() and read out to a perl buffer variable.
5. The ostream is set to the contents of that buffer.
Steps 4 and 5 aren't working as expected.
Note all of this Perl is taking place AFTER the closing root tag, so it has all the data.
Any ideas?
Can BINARY info be sent back into the ostream or is it best for FOP to write its own final file?
Also, can the data from the original ostream be discarded after this step, and the file that Teamsite creates, removed so we don't end up with TWO files (ie the PDF from FOP and the one Teamsite creates which is not the one wanted).
Thanks.
p.s. I am on Teamsite 6.5 and running on Linux.
Find more posts tagged with
Comments
erkel
in answer to my own question, it seems iwpt_set_ostream() does accept binary. phew.
tryout.rptdesign