Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Opening a pdf file stream using java

807569Aug 1 2006 — edited Aug 1 2006
I am developing a web app using jsp that needs to dynamically create xml files, then using fop I convert those files into pdf's.

I would need to be able to open multiple pdf files in a row...

Here's what I have so far....this will only open the 1st file...
I don't need to open the pdf files in a web browser, it can be done in acrobat reader if needs be...


do
{
if ( ( ( startRec * cache) + 1 ) <= ( min( ( startRec + 1 ) * cache, recCount ) ) )
{
System.out.println( ( startRec * cache ) + 1 + "-" + min( ( startRec + 1 ) * cache, recCount ) );

String xmlString = xmlStart;
for ( int n=( startRec * cache ); n<min( ( startRec + 1 ) * cache, recCount ); n++ )
{
ViewFileDetailsBean viewBean = (ViewFileDetailsBean)listOfViewFileDetailsBean.get(n);

xmlString = xmlString + viewBean.getxMLString();
}
xmlString = xmlString + "/t</data>\n"; // THIS FINISHES THE XML

pdfBean.makePDF( xmlString );

response.setContentLength( pdfBean.getOutput().length );
response.setContentType( "application/pdf" );
response.getOutputStream().write( pdfBean.getOutput() );
response.getOutputStream().flush();
}
startRec++;
}while ( startRec <= ( recCount / cache ) );



Thanks,

GoldenEye4ever
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 29 2006
Added on Aug 1 2006
6 comments
338 views