mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-05-15 14:15:54 -06:00
Added example of setting a watermark in Excel.
This commit is contained in:
parent
c0d12f3a5c
commit
8e358ae62b
11 changed files with 83 additions and 4 deletions
BIN
test/functional/src/images/watermark.png
Normal file
BIN
test/functional/src/images/watermark.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 321 KiB |
22
test/functional/src/test_header_image20.c
Normal file
22
test/functional/src/test_header_image20.c
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/*****************************************************************************
|
||||
* Test cases for libxlsxwriter.
|
||||
*
|
||||
* Test to compare output against Excel files.
|
||||
*
|
||||
* Copyright 2014-2022, John McNamara, jmcnamara@cpan.org
|
||||
*
|
||||
*/
|
||||
|
||||
#include "xlsxwriter.h"
|
||||
|
||||
int main() {
|
||||
|
||||
lxw_workbook *workbook = workbook_new("test_header_image20.xlsx");
|
||||
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
|
||||
|
||||
lxw_header_footer_options header_options = {.image_center = "images/watermark.png"};
|
||||
|
||||
worksheet_set_header_opt(worksheet, "&C&G", &header_options);
|
||||
|
||||
return workbook_close(workbook);
|
||||
}
|
||||
|
|
@ -100,6 +100,10 @@ class TestCompareXLSXFiles(base_test_class.XLSXBaseTest):
|
|||
self.ignore_elements = {'xl/worksheets/sheet1.xml': ['<pageMargins', '<pageSetup']}
|
||||
self.run_exe_test('test_header_image19')
|
||||
|
||||
def test_header_image20(self):
|
||||
self.ignore_elements = {'xl/worksheets/sheet1.xml': ['<pageMargins', '<pageSetup']}
|
||||
self.run_exe_test('test_header_image20')
|
||||
|
||||
# Test format strings with &[Picture] instead of &G.
|
||||
def test_header_image51(self):
|
||||
self.ignore_elements = {'xl/worksheets/sheet1.xml': ['<pageMargins', '<pageSetup']}
|
||||
|
|
|
|||
BIN
test/functional/xlsx_files/header_image20.xlsx
Normal file
BIN
test/functional/xlsx_files/header_image20.xlsx
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue