Added example of setting a watermark in Excel.

This commit is contained in:
John McNamara 2022-01-16 19:39:05 +00:00
parent c0d12f3a5c
commit 8e358ae62b
11 changed files with 83 additions and 4 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 KiB

View 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);
}

View file

@ -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']}

Binary file not shown.