PDF Generating Tool Support Forum

HOME   Login   Register    Search




  Subject: Render PDF on client machine
   PostPosted: 09 Mar 2011, 22:52 
Hi, i have a document that is build from a SQL query of a field that contains HTML previously entered by a HTMLEditor. Everything is fine but when i want to display the document from a client the document shows on the server not in the client machine, and of course i need the document shows on client machine i use the following code:

try {
/*no funca*/
// File f = new File("file://localhost/AsignaNombre.pdf"); //doesn't work
fos = new FileOutputStream("test.pdf ");
} catch (FileNotFoundException fe) {
...
}catch(Exception ex){
...
}
cPD4ML pd4ml = new cPD4ML();
//abre el pdf inicio
try {
.....
[database query with Resulset ]
......
//HTMLString store the HTML from the Oracle's CLOB query
pd4ml.render(new StringReader(HTMLString),output);
fos.close();
} catch (Exception e) {
...
}

try { // this shows the document on screen
Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler test.pdf");
} catch (IOException ioe) {
// TODO
System.out.println("Problema al abrir PDF "+ioe.getMessage());
ioe.printStackTrace();
}
i'm testing pd4ml evaluation if everything is right my company buy the licence, help me


  Subject: Re: Render PDF on client machine
   PostPosted: 11 Mar 2011, 10:43 
In order to show the document on client machine, you need to consider a web scenario (to deliver generated document to the machine by HTTP). There are many PD4ML servlet or JSP samples, which do the trick.


  Subject: Re: Render PDF on client machine
   PostPosted: 15 Mar 2011, 22:11 
PD4ML wrote:
In order to show the document on client machine, you need to consider a web scenario (to deliver generated document to the machine by HTTP). There are many PD4ML servlet or JSP samples, which do the trick.


Thanks in fact the problem was in java because it render on server meanwhile javascript render on client. A call from Javascript solves the problem.

Thanks for your time



[Reply]     [ 3 posts ] 

Copyright ©2004-10 zefer|org. All rights reserved. Bookmark and Share