Minor improvment for DRAFT watermark

This commit is contained in:
2025-03-10 21:47:19 +01:00
parent e8a41e9206
commit 64598f1e8f
+17 -5
View File
@@ -63,9 +63,11 @@ export const DraftButtons: React.FC = () => {
// Create the textbox on the master slide
const textBox = master.shapes.addTextBox("");
textBox.left = 0; // Center it horizontally
textBox.top = 0;
textBox.width = 960;
// textBox.left = 0; // Center it horizontally
textBox.left = -275
textBox.top = -5;
// textBox.width = 960;
textBox.width = 2400;
textBox.height = 540;
await context.sync();
@@ -91,7 +93,8 @@ export const DraftButtons: React.FC = () => {
// Set font properties exactly as in the VBA code
textBox.textFrame.textRange.font.name = "Inter";
textBox.textFrame.textRange.font.size = 256;
// textBox.textFrame.textRange.font.size = 256;
textBox.textFrame.textRange.font.size = 64;
textBox.textFrame.textRange.font.bold = true;
textBox.textFrame.verticalAlignment = "MiddleCentered"
@@ -100,7 +103,16 @@ export const DraftButtons: React.FC = () => {
textBox.textFrame.textRange.font.color = "#FFE9E8";
// Set the text
textBox.textFrame.textRange.text = "DRAFT";
textBox.textFrame.textRange.text =
"DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT\n" +
"DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT\n" +
"DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT\n" +
"DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT\n" +
"DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT\n" +
"DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT\n" +
"DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT\n" +
"DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT\n" +
"DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT\n";
} catch (fontError) {
console.error("Error setting font properties:", fontError);
// Even if we can't set the font properties exactly, continue with default font