Logo Search packages:      
Sourcecode: codeblocks version File versions  Download package

void wxPdfDocument::SaveAsFile ( const wxString &  name = wxEmptyString ) [virtual]

Saves the document to a file on disk.

The method first calls Close() if necessary to terminate the document.

Parameters:
nameThe name of the file. If not given, the document will be named 'doc.pdf'
See also:
Close()

Definition at line 1744 of file pdfdoc.cpp.

References Close(), m_buffer, and m_state.

{
  wxString fileName = name;
  // Finish document if necessary
  if (m_state < 3)
  {
    Close();
  }
  // Normalize parameters
  if(fileName.Length() == 0)
  {
    fileName = _T("doc.pdf");
  }
  // Save to local file
  wxFileOutputStream outfile(fileName);
  wxMemoryInputStream tmp(m_buffer);
  outfile.Write(tmp);
  outfile.Close();
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index