-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add shadow options to image properties #4
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running the following JS code in the sandbox produced the following presentation.
let pptx = new PptxGenJS();
let slide = pptx.addSlide();
slide.addImage({
x: 1,
y: 1,
path: "https://images.unsplash.com/photo-1506744038136-46273834b3fb?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwyMTIyMnwwfDF8c2VhcmNofDJ8fGxhbmRzY2FwZXxlbnwwfHx8fDE2NTg5MzE0MDM&ixlib=rb-1.2.1&q=80&w=1080",
shadow: {
type: "outer",
angle: 90,
blur: 50,
color: "FF0000",
offset: 100,
opacity: 0.5,
},
});
pptx.writeFile({ fileName: "PptxGenJS-Sandbox.pptx" });
I will note that while I was writing in the sandbox I made some errors which caused the shadow to not render. (I didn't wrap the shadow props in a shadow
object, and I put a #
at the beginning of the color string) It's good that the presentation could still render but there wasn't any feedback I had fed it bad data.
11353f5
to
99102ef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
I added a validation in the |
3dd9ae5
to
e5e8bfa
Compare
This will allow us to export preset shadows on image blocks.
Required for #44359