Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hyperlink to file throws exception #518

Closed
nicolajteknikteamet opened this issue Jun 18, 2023 · 1 comment
Closed

Hyperlink to file throws exception #518

nicolajteknikteamet opened this issue Jun 18, 2023 · 1 comment
Assignees
Labels
🐛 bug Something isn't working

Comments

@nicolajteknikteamet
Copy link

When setting a hyperlink to filename an exception is thrown "Hyperlink is invalid.".
Powerpoint should be able to link to other presentations.

Code below throws the exception.

using var sourcePresentation = SCPresentation.Open("SourceTemplate.pptx");
if (File.Exists("NewPresentation.pptx"))
{
File.Delete("NewPresentation.pptx");
}

sourcePresentation.SaveAs("NewPresentation.pptx");

//create four shapes with a long text in each
var slide = sourcePresentation.Slides[0];
for (int i = 0; i < 4; i++)
{
var shape = slide.Shapes.AddRectangle(150, 100 + 100 * i, 500, 50);
shape.TextFrame.Text = "This is a long text #" + i;

shape.TextFrame.Paragraphs[0].Portions[0].Hyperlink = "SourceTemplate.pptx";

}

sourcePresentation.Save();

@ashahabov
Copy link
Member

Thank you for the bug report. Please check this fix v0.45.3-beta.1

@ashahabov ashahabov self-assigned this Jun 18, 2023
@ashahabov ashahabov added the 🐛 bug Something isn't working label Jun 18, 2023
@pr-codex pr-codex bot mentioned this issue Jun 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants