PowerPoint Slides in Headers and Footers | |
PdfPowerPointSection puts a slide of a PowerPoint presentation into the header or footer band of a converted document, the way PdfHtmlSection puts html there - a banner designed in PowerPoint, for example. The presentation is given as a file path or a stream (pptx, pptm, potx, potm, ppsx or ppsm). It is rendered once, and the first slide is drawn on every page that shows the band, scaled to the band's width keeping the slide's shape, and cut at the band's height. Its web links stay clickable on every page.
PageRanges picks another slide (for example "2"), and Publish a notes or handout page instead of a slide.
A section is independent of the converter it heads: a PowerPoint band can head the pages of a PowerPointToPdf conversion or of an HtmlToPdf, Word or Excel one.
PdfPowerPointSection is available only in the full commercial SelectPdf library. |
A banner slide as the header of an html conversion. A 16:9 slide 160 points wide is 90 points high, so the band is made that high.
HtmlToPdf converter = new HtmlToPdf(); converter.Options.DisplayHeader = true; converter.Header.Height = 90; converter.Header.Add(new PdfPowerPointSection(0, 0, 160, "banner.pptx")); PdfDocument doc = converter.ConvertUrl("https://selectpdf.com"); doc.Save("page.pdf"); doc.Close();
The second slide of the same presentation as the footer of a Word conversion:
WordToPdf wordConverter = new WordToPdf(); wordConverter.Options.DisplayFooter = true; wordConverter.Footer.Height = 60; PdfPowerPointSection footer = new PdfPowerPointSection("banner.pptx"); footer.PageRanges = "2"; wordConverter.Footer.Add(footer); PdfDocument report = wordConverter.ConvertFile("report.docx"); report.Save("report.pdf"); report.Close();