Resize a powerpoint chart using OpenXml SDK2
-
vendredi 17 février 2012 17:14
Hi,
I'm new in OpenXml SDK 2. Is there anyway to resize a powerpoint chart in OpenXml SDK2?
Thanks in Advance,
Yi
Toutes les réponses
-
mardi 21 février 2012 13:23Modérateur
Hi, Yi
The question is being investigated, please wait some time.
Btw, You can look around a relavent task, to insert image to PowerPoint: http://social.msdn.microsoft.com/Forums/en-US/oxmlsdk/thread/6239fc1e-e0e0-4329-9692-d658c250e9a5
Best Regards,
Forrest Guo | MSDN Community Support | Feedback to us
-
mardi 21 février 2012 21:23Modérateur
Hi Yi,
Forrest Guo refers you to the following Forum thread where
there is a code snippet containing the C# code to draw a PowerPoint slide. You
may follow that as an exampleOpenXML: add image in PowerPoint
http://social.msdn.microsoft.com/Forums/en-US/oxmlsdk/thread/6239fc1e-e0e0-4329-9692-d658c250e9a5
Specifically in response to your question “Is there any way to
resize a PowerPoint chart in OpenXml SDK2?” once you have the code to build the
presentation, slides collection, and one or more slides, within the slide xml
part find the <p:xfrm.. element and manipulate the attributes of the <a:off… and the <a:ext elementsHere are two sets of those elements and attributes from a single slide where the x,
y, cx, and cy attributes are different, the difference resulting from manually
resizing a bar chart in Slide1Slide1.xml
<p:xfrm>
<a:off x:”1752600” y=”2362200”/>
<a:ext cx=”6096000” cy=”2844800”/>
</p:xfrm>
Slide1.xml
<p:xfrm>
<a:off x:”1371600” y=”1600200”/>
<a:ext cx=”6477000” cy=”3606800”/>
</p:xfrm>Please click on the “Mark as Answer” button if this reply
answers your question.
Regards,
Chris Jensen
Senior Technical Support Lead
Chris Jensen
- Proposé comme réponse Forrest GuoModerator mercredi 22 février 2012 01:18
- Marqué comme réponse Forrest GuoModerator lundi 27 février 2012 02:14
-
lundi 27 février 2012 02:15Modérateur
Yi,
I mark the answer, please check it.
Regards.
Forrest Guo | MSDN Community Support | Feedback to us
-
mardi 19 juin 2012 14:46
Thanks Forrest.
But this is not what I need. I need the C# code to resize the chart size.
Regards,
Yi
-
mardi 19 juin 2012 15:55Modérateur
Above code is the markup xml of the document. You may also manually set chart size, then reflect code with OpenXml Productivity Tool. This will generate C# code for the document. You can regenrate document with the code, of course you can change size before run code.
thanks,
Forrest Guo | MSDN Community Support | Feedback to manager

