Spread Silverlight Documentation
SavePdf(Stream) Method
Example 


The stream to which to save the data.
Saves the sheet to the specified stream.
Syntax
'Declaration
 
Public Overloads Sub SavePdf( _
   ByVal stream As System.IO.Stream _
) 
'Usage
 
Dim instance As Worksheet
Dim stream As System.IO.Stream
 
instance.SavePdf(stream)
public void SavePdf( 
   System.IO.Stream stream
)

Parameters

stream
The stream to which to save the data.
Example
This example prints to a PDF file.
SaveFileDialog saveFileDialog = new SaveFileDialog();
saveFileDialog.Filter = "PDF File (.pdf)|*.pdf";
bool? useClick = saveFileDialog.ShowDialog();
if (useClick == true)
{
    var stream = saveFileDialog.OpenFile();

GrapeCity.Windows.SpreadSheet.Data.PdfExportSettings test;
test = new GrapeCity.Windows.SpreadSheet.Data.PdfExportSettings();
test.Title = "Print PDF";
test.Author = "GrapeCity, Inc.";
test.DisplayDocTitle = true;
test.FitWindow = true;
gcSpreadSheet1.SavePDF(stream, 0);
//gcSpreadSheet1.SavePDF(stream, test, 0);
 stream.Dispose();
}
Dim saveFileDialog = New SaveFileDialog()
saveFileDialog.Filter = "PDF File(.pdf)|*.pdf"
Dim useClick As Boolean = saveFileDialog.ShowDialog()
If (useClick = True) Then
Dim stream = saveFileDialog.OpenFile()

Dim test As New GrapeCity.Windows.SpreadSheet.Data.PdfExportSettings()
test.Title = "Print PDF"
test.Author = "GrapeCity, Inc."
test.DisplayDocTitle = True
test.FitWindow = True
GcSpreadSheet1.SavePDF(stream, 0)
'GcSpreadSheet1.SavePDF(stream, test, 0)
End If
Requirements

Target Platforms: Windows 7, Windows 8 Desktop, Windows Vista SP1 or later, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

Reference

Worksheet Class
Worksheet Members
Overload List

 

 


Copyright © GrapeCity, inc. All rights reserved.