1 #include <Wt/WApplication>
14 void* hndl = dlopen(
"libwt.so", RTLD_NOW | RTLD_GLOBAL);
16 LOG(
ERROR) <<
"WsModPdf :: Cannot load libwt.so shared library! " << dlerror();
23 : WContainerWidget(parent)
36 WContainerWidget::load();
38 resize(WLength(100, WLength::Percentage), WLength(100, WLength::Percentage));
39 setOverflow(WContainerWidget::OverflowAuto);
40 std::string p1 = Wt::WApplication::instance()->internalPath();
44 std::string javaScript =
"\
45 PDFJS.workerSrc='" + WApplication::instance()->resourcesUrl() +
"webpdf/pdf.js';\
46 PDFJS.getPdf('" + p +
"', function getPdf(data) {\
47 var pdf = new PDFJS.PDFDoc(data);\
48 var page = pdf.getPage(1);\
50 var canvas = document.getElementById('pdf');\
51 var context = canvas.getContext('2d');\
52 canvas.height = page.height * scale;\
53 canvas.width = page.width * scale;\
55 WApplication::instance()->doJavaScript(javaScript);
67 WApplication::instance()->require(WApplication::instance()->resourcesUrl() +
"webpdf/pdf.js");
104 return "WsModPdf wittyShare module";
const std::string & diffPath() const
const std::vector< WsOption > & options() const
Get all options.
Wt::WWidget * createContents(Wt::WContainerWidget *parent=0) const
Create the contents.
void setDiffPath(const std::string &diffPath)
Wt::WWidget * createContentsMenuBar(Wt::WContainerWidget *parent=0) const
Create the functionalities.
Wt::WWidget * createAdmin(Wt::WContainerWidget *parent=0) const
Create the contents for an administrator.
WsPdf(Wt::WContainerWidget *parent=0)
WsEditorWidget * createEditor(Wt::WContainerWidget *parent=0) const
Create the contents for an editor (create a view of options).
void setOptions(const std::vector< WsOption > &vOptions)
Set all options.
std::string description() const
Return the description of the module.