Replies: 2 comments 2 replies
-
Hello @JNISGHX , thank you for your feedback. I'm glad to know that the library helps people in their projects😊 Hyperlink handling is not supported in ShapeCrawler at the present. But we will add it in the one of next versions. You can use the following code to add hyperlink for text. It is not elegant but should help you to start. using DocumentFormat.OpenXml.Packaging;
using P = DocumentFormat.OpenXml.Presentation;
using A = DocumentFormat.OpenXml.Drawing;
using var doc = PresentationDocument.Open(@"c:\temp\test.pptx", true);
var slidePart = doc.PresentationPart!.SlideParts.First();
var shapes = slidePart.Slide.CommonSlideData!.ShapeTree!.OfType<P.Shape>();
var paragraph = shapes.First().TextBody.Elements<A.Paragraph>().First();
var run = paragraph.Descendants<A.Run>().First();
var uri = new Uri("https://github.com/ShapeCrawler/ShapeCrawler/discussions/241", UriKind.Absolute);
var rId = $"rId-{Guid.NewGuid().ToString("N")[..5]}";
slidePart.AddHyperlinkRelationship(uri, true, rId);
var hyperlinkOnClick = new A.HyperlinkOnClick { Id = rId };
run.RunProperties.Append(hyperlinkOnClick); Feel free to touch me if this is not what you are trying to achieve. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hyperlink handling is supported now in v0.29.0 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I didn't see this in any of the issues or on this forum, I apologize if I missed a previous discussion on this.
I'm loving this library and what it does has saved me a ton of time. Thank you Adam
I'm using it to take jira data and create a powerpoint summarizing the work done in a sprint. I'm using a pptx as a template and have it formatted and structured how I want with named tables and inserting data as needed in each column. What I would like to do is in the column where I'm showing the jira ticket id is to hyperlink that with the link to access that ticket in jira. This actually seems to be the last leg of my project and I'm wondering if this is doable with your library or if I would have to scour the net to find an example of that being done using OpenXML.
Beta Was this translation helpful? Give feedback.
All reactions