Changeset - 3809c04020b4
[Not reviewed]
default
0 1 0
Roeland Merks - 15 years ago 2010-11-29 17:21:54
roeland.merks@cwi.nl
Note: I only fixed the PDF problem. Not the other issues.
1 file changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/mainbase.cpp
Show inline comments
 
@@ -327,12 +327,13 @@ int MainBase::Save(const char *fname, co
 

	
 
  if (QString(fname).isEmpty()) {
 
    MyWarning::warning("No output filename given. Saving nothing.\n");
 
    return 1;
 
  }
 

	
 
  
 
  ll*=Cell::Magnification(); ur*=Cell::Magnification();
 

	
 
  // give the leaf some space
 
  Vector border = ((ur-ll)/5.);
 
  
 
  if (!QString(format).contains("PDF", Qt::CaseInsensitive)) {
 
@@ -354,13 +355,13 @@ int MainBase::Save(const char *fname, co
 
    delete image;
 
  } else {
 
    QPrinter pdf(QPrinter::HighResolution);
 
    pdf.setOutputFileName(fname);
 
    pdf.setOutputFormat(QPrinter::PdfFormat);
 
    QPainter painter(&pdf);
 
    canvas.render(&painter, QRectF(), QRectF(-5000,-5000, 10000, 10000));
 
    canvas.render(&painter, QRectF(), QRectF(-500,-500, 1000, 1000)); // NB Fiddle with these arguments if relative size of PDF images is important.
 
    
 
    cerr << "Rendering to printer\n";
 
  }
 
  return 0;
 
}
 

	
0 comments (0 inline, 0 general)