Actions
Bug #5256
openLinking errors with Pre-built binaries for Visual Studio
Description
Using pre-built libraries for Html->Pdf causes linker errors with Installing_Wt_on_MS_Windows.
Bug reproducible with;
- Wt-3.3.5 and Wt-3.3.6 on Visual Studio 2013 or Wt-3.3.6 on Visual Studio 2015
- HPDF_DLL defined
- Linking libhpdfd.lib, wtd.lib, wthttpd.lib, wtdbod.lib, wtisapid.lib, wttestd.lib in Debug Build
<!-- -->
#include <hpdf.h>
#include <Wt/Render/WPdfRenderer>
namespace {
void __stdcall error_handler(HPDF_STATUS error_no, HPDF_STATUS detail_no,
void *user_data) {
fprintf(stderr, "libharu error: error_no=%04X, detail_no=%d\n",
(unsigned int)error_no, (int)detail_no);
}
}
using namespace Wt;
int main() {
HPDF_Doc pdf = HPDF_New(error_handler, 0);
HPDF_Page page = HPDF_AddPage(pdf);
HPDF_Page_SetSize(page, HPDF_PAGE_SIZE_A4, HPDF_PAGE_PORTRAIT);
Render::WPdfRenderer renderer(pdf, page);
renderer.setMargin(2.54);
renderer.setDpi(96);
renderer.render("<p style=\"background-color: #c11\">Hello, world !</p>");
HPDF_SaveToFile(pdf, "hello.pdf");
HPDF_Free(pdf);
}
Files
No data to display
Actions