Re: PDF files



On Mon, 25 Jun 2007 19:17:13 -0000, Raspberry <mory2311@xxxxxxxxx>
wrote:

Hi,
I'm a beginner java developer, and I'm developing a desktop
application, it contains form generate reports for user in pdf format
and save it in temporary file.
when user view the archived report, he could save it in another path
(for example: myDocuments)... but the new saved file is empty except
from a logo
this is the code to save the pdf ... can anybody help my to find the
problem? thanx in advance

public void export(){
Properties m_ctx=Env.getCtx();
JFileChooser chooser = new JFileChooser();
chooser.setDialogType(JFileChooser.SAVE_DIALOG);
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
chooser.setDialogTitle(Msg.getMsg(Env.getCtx(), "Export"));
chooser.addChoosableFileFilter(new
ExtensionFileFilter("pdf" ,Msg.getMsg(m_ctx, "FilePDF")));

if(chooser.showSaveDialog(this)!= JFileChooser.APPROVE_OPTION)
return;

File file =
ExtensionFileFilter.getFile(chooser.getSelectedFile(),
chooser.getFileFilter());
Viewer viewer = new Viewer();
try{
PDFGenerator.getPDFAsStream(new
FileOutputStream(file),layoutEngine.getPageable(false));
file.createNewFile();
The documentation for createNewFile says: "creates a new, empty file".
Is that "empty" the source of your problem? After you create it you
seem to exit your method without having put anything into the file.

rossum


}catch(Exception e){
e.printStackTrace();
}

.



Relevant Pages

  • PDF files
    ... I'm a beginner java developer, ... it contains form generate reports for user in pdf format ... Viewer viewer = new Viewer; ...
    (comp.lang.java.programmer)
  • Re: Exporting a report to Excel
    ... with Project's reports are to "print" them to a PDF format ... ... & pasting the output of the PDF document into Excel is an option - but it's ... you might like to look at is analyze timescaled data in excel option - it's ...
    (microsoft.public.project)
  • Re: export access to word with image
    ... so the pdf format won't do it. ... poor quality and only shows a corner of the image. ... reports to word, therefore, It available from: ... Lebans code? ...
    (microsoft.public.access.gettingstarted)
  • Re: Sending An access report in PDF format
    ... Sorry, Stan, this is not possible with a macro. ... > I have created reports in access using the Adobe Acrobat ... > I would like to use the sendobject command to send the ... > Is there a way to add the PDF format. ...
    (microsoft.public.access.macros)