Changeset 200 in PSPA


Ignore:
Timestamp:
Dec 18, 2012, 4:55:31 PM (12 years ago)
Author:
garnier
Message:

ajout de lien, et en test pour sauver en pdf

Location:
Interface_Web/trunk/pspaWT
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Interface_Web/trunk/pspaWT/include/GWt_pspaApplication.h

    r196 r200  
    1313#include <Wt/WPushButton>
    1414#include <Wt/WDialog>
     15#include <Wt/WPdfImage>
     16#include <Wt/Chart/WCartesianChart>
     17#include <Wt/WLength>
    1518
    1619#include "dataManager.h"
  • Interface_Web/trunk/pspaWT/src/GWt_pspaApplication.cc

    r199 r200  
    2525#include <Wt/WDialog>
    2626#include <Wt/WStandardItemModel>
    27 #include <Wt/Chart/WCartesianChart>
    2827#include <Wt/WFileUpload>
     28#include <Wt/WPainter>
     29#include <Wt/WPdfImage>
     30#include <Wt/WRasterImage>
    2931
    3032using namespace Wt::Chart;
     
    5456   */
    5557  WGridLayout *layout = new WGridLayout();
     58  layout->addWidget(createTitle("<a href='../workingArea/parmin'> Menu (In future)</a>"), 0, 0, 1, 2);
    5659  layout->addWidget(createTitle("Menu (In future)"), 0, 0, 1, 2);
    5760
     
    213216  WContainerWidget* dessin = new WContainerWidget();
    214217
    215   dessin->addWidget(new WText(" graphic analysis :  "));
     218
     219  dessin->addWidget(new WText("graphic analysis :  "));
    216220  dessin->addWidget(new WBreak());
    217221  dessin->addWidget(new WText(" drawing after element :  "));
     
    718722
    719723  chart->resize(300, 300); // WPaintedWidget must be given explicit size
     724 
     725
     726  Wt::WPdfImage pdfImage("4cm", "3cm");
     727 
     728  Wt::WPainter p(&pdfImage);
     729  chart->paint(p);
     730 
     731  std::ofstream f("chart.pdf", std::ios::out | std::ios::binary);
     732  pdfImage.write(f);
     733  new WText("<a href='chart.pdf'>Download</a>",toto);
    720734
    721735  //  chart->setMargin(10, Top | Bottom);            // add margin vertically
Note: See TracChangeset for help on using the changeset viewer.