Short story: I need to create pictures from reports.I found a good piece of code that seem to work great with PreviewPrintController now I was wondering if there was something similar I could do with Crystal.
Friend Class PrintControllerFile
Inherits PreviewPrintController
.....
Public Overloads Overrides Sub OnEndPage(ByVal document As PrintDocument, ByVal e As PrintPageEventArgs)
MyBase.OnEndPage(document, e)
' Get the current Metafile
Dim ppia As PreviewPageInfo() = GetPreviewPageInfo()
Dim ppi As PreviewPageInfo = ppia(ppia.Length - 1)
Dim image As Image = ppi.Image
_Metafile = DirectCast(image, Metafile)
' using ( _Metafile )
If _Format Is ImageFormat.Emf Then
_Metafile.Save(PagePath, _Format)
Return
End If
If _Format Is ImageFormat.Wmf Then
_Metafile.Save(PagePath, _Format)
Return
End If
' _Metafile.Save( PagePath, _Format );
SaveViaBitmap(document, e)
End Sub
In a normal "Print Preview" the PreviewPrintController generate metafiles and save these as the output. By inheriting the PreviewPrintController class you can then override the saving process and save those metafiles as jpeg or whatever. I want to the same thing with Crystal if possible.
This is where I took my code:
Any help, hint, suggestion will be appreciate. Thanks in advance and sorry for my poor english.
Friend Class PrintControllerFile
Inherits PreviewPrintController
.....
Public Overloads Overrides Sub OnEndPage(ByVal document As PrintDocument, ByVal e As PrintPageEventArgs)
MyBase.OnEndPage(document, e)
' Get the current Metafile
Dim ppia As PreviewPageInfo() = GetPreviewPageInfo()
Dim ppi As PreviewPageInfo = ppia(ppia.Length - 1)
Dim image As Image = ppi.Image
_Metafile = DirectCast(image, Metafile)
' using ( _Metafile )
If _Format Is ImageFormat.Emf Then
_Metafile.Save(PagePath, _Format)
Return
End If
If _Format Is ImageFormat.Wmf Then
_Metafile.Save(PagePath, _Format)
Return
End If
' _Metafile.Save( PagePath, _Format );
SaveViaBitmap(document, e)
End Sub
In a normal "Print Preview" the PreviewPrintController generate metafiles and save these as the output. By inheriting the PreviewPrintController class you can then override the saving process and save those metafiles as jpeg or whatever. I want to the same thing with Crystal if possible.
This is where I took my code:
Any help, hint, suggestion will be appreciate. Thanks in advance and sorry for my poor english.