128 | {
129 | {"QRCode", qrImageElement },
130 | {"ProductImage", productImageElement }
131 | };
132 |
133 | /*
134 | *
135 | *
136 | * Execution of conversion tests
137 | *
138 | *
139 | */
140 |
141 | //Most important: give the full path to the soffice.exe file including soffice.exe.
142 | //Don't know how that would be named on Linux...
143 | var test = new ReportGenerator(locationOfLibreOfficeSoffice);
144 |
145 | //Convert from HTML to HTML
146 | test.Convert(htmlLocation, Path.Combine(Path.GetDirectoryName(htmlLocation), "Test-HTML-page-out.html"), placeholders);
147 |
148 | //Convert from HTML to PDF
149 | test.Convert(htmlLocation, Path.Combine(Path.GetDirectoryName(htmlLocation), "Test-HTML-page-out.pdf"), placeholders);
150 |
151 | //Convert from HTML to DOCX
152 | test.Convert(htmlLocation, Path.Combine(Path.GetDirectoryName(htmlLocation), "Test-HTML-page-out.docx"), placeholders);
153 |
154 | //Convert from DOCX to DOCX
155 | test.Convert(docxLocation, Path.Combine(Path.GetDirectoryName(htmlLocation), "Test-Template-out.docx"), placeholders);
156 |
157 | //Convert from DOCX to HTML
158 | test.Convert(docxLocation, Path.Combine(Path.GetDirectoryName(htmlLocation), "Test-Template-out.html"), placeholders);
159 |
160 | //Convert from DOCX to PDF
161 | test.Convert(docxLocation, Path.Combine(Path.GetDirectoryName(htmlLocation), "Test-Template-out.pdf"), placeholders);
162 |
163 | }
164 | }
165 | }
166 |
--------------------------------------------------------------------------------
/ExampleApplication/QRCode.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/smartinmedia/Net-Core-DocX-HTML-To-PDF-Converter/814a76ce8985d26d3d3d3acfef7d7b5d8628a1a6/ExampleApplication/QRCode.PNG
--------------------------------------------------------------------------------
/ExampleApplication/Test-HTML-page.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Template Engine DocX HTML to PDF
7 |
8 |
9 | Created by ©Smart In Media 2019, //Website//
10 | 
11 | This is a simple example for a HTML template to use with the NET Core DocX/HTML to PDF Converter
12 |
13 | To:
##Name##
##Street##
##City##
14 |
15 |
16 | Invoice ###InvoiceNo##
17 | ##Date##
18 |
19 |
20 | It has the following features:
21 | Conversion from / to these formats:
22 |
23 |
24 |
25 |
26 | Quantity |
27 | Product |
28 | Pricing |
29 |
30 |
31 |
32 |
33 |
34 | ==Qty== |
35 | ==Product== |
36 | ==Price== |
37 |
38 |
39 | | | ##Total## |
40 |
41 |
42 |
43 | Contact us through our website (scan QR code):
44 | ++QRCode++
45 |
46 |
47 |
48 |
49 | Name |
50 | Dept |
51 | Responsibility |
52 | Tel |
53 |
54 |
55 | ==Name== |
56 | ==Department== |
57 | ==Responsibility== |
58 | ==Telephone number== |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/ExampleApplication/Test-Template.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/smartinmedia/Net-Core-DocX-HTML-To-PDF-Converter/814a76ce8985d26d3d3d3acfef7d7b5d8628a1a6/ExampleApplication/Test-Template.docx
--------------------------------------------------------------------------------
/ExampleApplication/smartinmedia.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/smartinmedia/Net-Core-DocX-HTML-To-PDF-Converter/814a76ce8985d26d3d3d3acfef7d7b5d8628a1a6/ExampleApplication/smartinmedia.jpg
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Smart In Media GmbH & Co. KG
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------