Support PDF-export from Python

This commit is contained in:
Gaute Lindkvist
2020-01-21 12:36:22 +01:00
parent 1133816471
commit e1c1981830
9 changed files with 59 additions and 20 deletions

View File

@@ -50,7 +50,12 @@ CAF_CMD_SOURCE_INIT( RicSnapshotViewToFileFeature, "RicSnapshotViewToFileFeature
//--------------------------------------------------------------------------------------------------
void RicSnapshotViewToFileFeature::saveSnapshotAs( const QString& fileName, RimViewWindow* viewWindow )
{
if ( viewWindow )
RimPlotWindow* plotWindow = dynamic_cast<RimPlotWindow*>( viewWindow );
if ( plotWindow && fileName.endsWith( ".pdf" ) )
{
savePlotPDFReportAs( fileName, plotWindow );
}
else if ( viewWindow )
{
QImage image = viewWindow->snapshotWindowContent();
saveSnapshotAs( fileName, image );