[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master e7d763d 066/156: Add company logo display to
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master e7d763d 066/156: Add company logo display to the PDF illustration header |
Date: |
Tue, 30 Jan 2018 17:22:12 -0500 (EST) |
branch: master
commit e7d763d4bab46853a1daf08587d09873dae63b19
Author: Vadim Zeitlin <address@hidden>
Commit: Vadim Zeitlin <address@hidden>
Add company logo display to the PDF illustration header
This requires associating a wxFileSystem with wxHTML parser used, in
order to enable loading images during run-time.
---
header.mustache | 2 ++
pdf_writer_wx.cpp | 3 +++
pdf_writer_wx.hpp | 6 ++++++
3 files changed, 11 insertions(+)
diff --git a/header.mustache b/header.mustache
index 4ec8747..85d9de8 100644
--- a/header.mustache
+++ b/header.mustache
@@ -1,3 +1,5 @@
+<img src="company_logo.png"></img>
+
<font size=-1>
<p align="center">
{{#IsInforce}}
diff --git a/pdf_writer_wx.cpp b/pdf_writer_wx.cpp
index 6b4ab4d..ebed4ed 100644
--- a/pdf_writer_wx.cpp
+++ b/pdf_writer_wx.cpp
@@ -26,6 +26,7 @@
#include "alert.hpp"
#include "html.hpp"
+#include <wx/filesys.h>
#include <wx/html/htmlcell.h>
namespace
@@ -102,6 +103,8 @@ pdf_writer_wx::pdf_writer_wx
,"Courier"
);
}
+ html_vfs_.reset(new wxFileSystem());
+ html_parser_.SetFS(html_vfs_.get());
}
/// Output an image at the given scale into the PDF.
diff --git a/pdf_writer_wx.hpp b/pdf_writer_wx.hpp
index 8c683df..4634f7c 100644
--- a/pdf_writer_wx.hpp
+++ b/pdf_writer_wx.hpp
@@ -34,6 +34,8 @@
#include <array>
#include <memory> // std::unique_ptr
+class wxFileSystem;
+
namespace html { class text; }
class pdf_writer_wx
@@ -86,6 +88,10 @@ class pdf_writer_wx
private:
wxPrintData print_data_;
wxPdfDC pdf_dc_;
+
+ // Order is potentially important here: html_parser_ uses html_vfs_, so
+ // must be declared after it in order to be destroyed before it.
+ std::unique_ptr<wxFileSystem> html_vfs_;
wxHtmlWinParser html_parser_;
wxSize const total_page_size_;
- [lmi-commits] [lmi] master updated (70fb246 -> 408ba18), Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master cfdf224 016/156: Use raw multiline string instead of concatenating several strings, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 1d99e76 008/156: Make pdf_writer_wx::output_html() type safe by taking html::text, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master e43a485 005/156: Further improve wxPdfDocument API encapsulation and reuse, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 7d278ef 011/156: Add footer to the cover page, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master d5d8185 057/156: Add tabular_details page, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master bb64784 013/156: Add a helper allowing to interpolate variables in strings, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master b72ced6 014/156: Replace ad hoc illustration properties with HTML interpolator, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master e7d763d 066/156: Add company logo display to the PDF illustration header,
Greg Chicares <=
- [lmi-commits] [lmi] master f575c94 003/156: Refactor more group_quote_pdf_gen_wx code to allow its reuse, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 5e2fc70 007/156: Make HTML generation utilities more type-safe, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 7ed2bbf 027/156: Simplify footer generation code by moving font tag outside, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master d7244c1 043/156: Change the colour used for lines and borders, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 41ae40d 089/156: Fix wrong "<br>" tag in the header template, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master acb7aae 049/156: Add numbered_page::get_extra_pages_needed() hook, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master c0d68e1 122/156: Add rate of return pages of the individual placement illustration, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 875ca7d 039/156: Rename StateIsTX ledger variable to StateIsTexas, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 31048c8 047/156: Make wx_table_generator even more customizable, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 10dd0a9 051/156: Factor enum_output_mode into a separate header to allow its reuse, Greg Chicares, 2018/01/30