Hi,
I am trying to modify the handout header and footer values of a presentation. I am talking about the options you can set in power point in the second tab of the header / footer configuration about notes and handouts:
image.png (8.4 KB)
I tried the following code to modify the data:
var masterNoteSlide = pres.MasterNotesSlideManager.MasterNotesSlide;
foreach (var shape in masterNoteSlide.Shapes)
{
if (shape.Placeholder != null)
{
if (shape.Placeholder.Type == PlaceholderType.Header)
{
((IAutoShape) shape).AddTextFrame("New header text");
}
}
}
and later render the power point to pdf in notes mode:
var po = new PdfOptions();
pres.Save("file.pdf", SaveFormat.PdfNotes, po);
If I open the created PDF file I still see the old value header handout in the top left corner:
image.png (3.4 KB)
I am pretty sure the code I have written should work, as if I inspect the individual shape in the upper foreach loop and check its TextFrame.Text property, it has the original text defined in my example presentation:
image.png (30.6 KB)
So I assume the text is not updated correctly if I call AddTextFrame method, even it´s description says, it would change the frames text if it already exists.
I am facing the same issue with the DateAndTime and Footer placeholder shapes.
Also another question: What would be the best way to create those shapes if they do not already exist? As if I check the Shapes.AddAutoShape
I would have to set position etc. manually.
I attached you my example presentation and the PDF output.
files.zip (246.5 KB)
Kind regards,
Daniel