Pdf PowerPoint Element | |
PdfPowerPointElement draws the slides of a PowerPoint presentation into a region of a pdf page, the way PdfWordElement draws a Word document there. The presentation is given as a file path or a stream (pptx, pptm, potx, potm, ppsx or ppsm) and is rendered in-process at render time. Each rendered page - a slide, a notes page or a handout page, per Publish - keeps its shape, scaled to the element's width: the pages are stacked from the element's position and continue on the pages that follow. The links stay clickable.
Coordinates and sizes are in the page's client-area coordinate system, relative to the top-left corner of the writable area inside the page margins. Width defaults to the client width minus X; Height decides how the content flows:
A fixed height that fits its page shows what fits in it.
The default, -1, lets the slides flow onto the pages that follow, using the document's next page when there is one and appending one when there is not.
A fixed height taller than what is left of the page continues on the pages that follow, the same way, until that much height has been drawn.
PdfPowerPointElement is available only in the full commercial SelectPdf library. |
The slides of a presentation, 300 points wide, below a title drawn from code:
PdfDocument doc = new PdfDocument(); PdfPage page = doc.AddPage(); PdfFont titleFont = PdfFont.CreateStandardFont(PdfStandardFont.HelveticaBold, 20); page.Add(new PdfTextElement(0, 0, "Annex C - the presentation", titleFont, new PdfColor(44, 62, 80))); // the slides stacked from 50pt down, continuing on the pages after it PdfPowerPointElement deck = new PdfPowerPointElement(0, 50, 300, "deck.pptx"); PdfRenderingResult result = page.Add(deck); // where each slide landed, and the page the region ended on SelectPdf.Universal.Drawing.RectangleF[] slides = deck.PdfPagesRectangles; int lastPage = result.PdfPageLastIndex; doc.Save("annex.pdf"); doc.Close();
One slide, the third, in a fixed rectangle:
Added to a header, footer or stamp template (Templates), the element draws the first rendered page on every page the template applies to and re-creates its web links on each of them.
On a page of a tagged document the region carries its own structure: the slides' titles, text, tables, pictures and links join the host document's logical structure, in the reading order, at the place the region was drawn - so a document declaring PDF/UA-1 or PDF/UA-2 stays conformant with a PowerPoint region on it. Tagged asks for that structure on a document that is not tagged itself. Set Artifact to declare the whole region decorative instead.
In a header, footer or stamp the element is refused on a tagged document unless it is decorative: a band repeats on every page, so its content has no single place in a reading order.