Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ConversionConfig conversionConfig = new ConversionConfig();
conversionConfig.setStoragePath("source file path");
conversionConfig.setOutputPath("output path");
ConversionHandler conversionHandler = new ConversionHandler(conversionConfig);
String sourceFileName = "source.pptx";
PdfSaveOptions saveOptions = new PdfSaveOptions();
WatermarkOptions watermarkOptions = new WatermarkOptions();
watermarkOptions.setText("Watermark text");
watermarkOptions.setColor(Color.blue);
watermarkOptions.setFont(new Font("Arial", 40, 12));
watermarkOptions.setRotationAngle(45);
watermarkOptions.setTransparency(0.1);
watermarkOptions.setLeft(200);
watermarkOptions.setTop(400);
saveOptions.getWatermarkOptions().setBackground(true);
saveOptions.setWatermarkOptions(watermarkOptions);
ConvertedDocument result = conversionHandler.<String> convert(sourceFileName, saveOptions);
result.save(sourceFileName + "." + result.getFileType());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.