Skip to content

Commit bbe6430

Browse files
committed
rev3.2a fixed .pdf 3D page break
1 parent 2577f61 commit bbe6430

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

surfacemanager.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2727,21 +2727,27 @@ void SurfaceManager::report(){
27272727
}
27282728
QString contour("mydata://contour.png");
27292729
doc->addResource(QTextDocument::ImageResource, QUrl(contour), QVariant(contWindow));
2730-
contourHtml.append( "<table style=\"page-break-before:always\" border = \"1\"><tr><th>Contour Plot</th></tr> <tr><td> <img src='" +
2731-
contour + "'></td></tr></table><br>");
2730+
contourHtml.append( "<p><table style=\"page-break-before:always\" border = \"1\"><tr><th>Contour Plot</th></tr> <tr><td> <img src='" +
2731+
contour + "'></td></tr></table></p>");
27322732

27332733
}
27342734

27352735
// get the 3D image
27362736
if (dlg.show_3D){
27372737
QString threeD("threeD.png");
2738+
m_oglPlot->resize(600,600);
27382739
QImage ddd = m_oglPlot->grabFrameBuffer();
27392740
if (dlg.reduce3D){
27402741
ddd = ddd.scaled(3 * ddd.width()/4, ddd.height()/2,Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
2742+
doc->addResource(QTextDocument::ImageResource, QUrl(threeD), QVariant(ddd));
2743+
contourHtml.append("<table border = \"1\"><tr><th><h2>3D Surface Plot</h2></th></tr> <tr><td> <img src='" +
2744+
threeD + "'</td></tr></table><br>");
27412745
}
2746+
else {
27422747
doc->addResource(QTextDocument::ImageResource, QUrl(threeD), QVariant(ddd));
2743-
contourHtml.append("<table border = \"1\"><tr><th><h2>3D Surface Plot</h2></th></tr> <tr><td> <img src='" +
2748+
contourHtml.append("<table style=\"page-break-before:always\" border = \"1\"><tr><th><h2>3D Surface Plot</h2></th></tr> <tr><td> <img src='" +
27442749
threeD + "'</td></tr></table><br>");
2750+
}
27452751
}
27462752

27472753
if (dlg.show_profile){

0 commit comments

Comments
 (0)