Hey, another issue is related to PPTX files during tile watermarking. There are two issues that I would like to underline.
Firstly, it looks like line_spacing value is completely broken (e.g there is almost no difference between 100.0 and 200.0 POINTS / PIXELS and it accepts negative values which work in strange way as well).
Secondly, in case of specifying rotate_angle for tile pattern, watermarks are visible and added far beyond the content of the page. I’ve noticed that this bug is not that bad in case of setting positive value, but it’s pretty annoying in case of negative value. I’m attaching screenshots for both.
Negative -45.0 rotate_angle value - Screenshot 2024-12-15 at 20.24.24.jpg (80.3 KB)
Positive 45.0 rotate_angle value - Screenshot 2024-12-15 at 20.25.14.png (82.3 KB)
The overall code snippet that I’m using:
def main():
document_path = 'input.pptx'
output_document_path = 'output.pptx'
with gw.Watermarker(document_path) as watermarker:
font = gww.Font('Helvetica', 12.0)
watermark = gww.TextWatermark(f'{USER_EMAIL}\n{FILE_ID}\n{DISCLAIMER}', font)
watermark.foreground_color = gww.Color.gray
watermark.opacity = 0.4
watermark.rotate_angle = -45.0
watermark.text_alignment = gww.TextAlignment.CENTER
line_spacing = gww.MeasureValue()
line_spacing.measure_type = gww.TileMeasureType.POINTS
line_spacing.value = 100.0
watermark_spacing = gww.MeasureValue()
watermark_spacing.measure_type = gww.TileMeasureType.POINTS
watermark_spacing.value = 50.0
watermark.tile_options = gww.TileOptions()
watermark.tile_options.line_spacing = line_spacing
watermark.tile_options.watermark_spacing = watermark_spacing
watermark_options = gwop.PresentationWatermarkSlideOptions()
watermark_options.is_locked = True
watermarker.add(watermark, options=watermark_options)
watermarker.save(output_document_path)
Do you have any ideas how I can fix this in current latest version or maybe you already have plans / ideas for fixing these two issues in next versions?
Thanks for your response in advance