GetXDocument fails for VMLPart.
Home › Forums › PresentationML › GetXDocument fails for VMLPart.
This topic contains 2 replies, has 2 voices, and was last updated by princrai 8 years, 7 months ago.
-
AuthorPosts
-
May 12, 2016 at 2:14 am #3388
Hi Eric,
I was trying to run PresentationBuilder for one of the PPT document and it was failing at vmlPart.GetXDocument(). I am able to open the PPT document successfully but when running through the PresentationBuilder it throws an exception for vmlPart.GetXDocument() saying (‘if’ is an unexpected token. The expected token is ‘CDATA[‘. Line 55, position 6.). Pasted the vmlDrawings.vml below:
<![if gte mso 9]> is the line at which it throws the exception. I am not sure if I am able to open the PPT document why are we not able to load the xml in GetXDocument().<xml xmlns:v=”urn:schemas-microsoft-com:vml”
xmlns:o=”urn:schemas-microsoft-com:office:office”
xmlns:p=”urn:schemas-microsoft-com:office:powerpoint”
xmlns:oa=”urn:schemas-microsoft-com:office:activation”>
<o:shapelayout v:ext=”edit”>
<o:idmap v:ext=”edit” data=”1″/>
</o:shapelayout><v:shapetype id=”_x0000_t75″ coordsize=”21600,21600″ o:spt=”75″
o:preferrelative=”t” path=”m@4@5l@4@11@9@11@9@5xe” filled=”f” stroked=”f”>
<v:stroke joinstyle=”miter”/>
<v:formulas>
<v:f eqn=”if lineDrawn pixelLineWidth 0″/>
<v:f eqn=”sum @0 1 0″/>
<v:f eqn=”sum 0 0 @1″/>
<v:f eqn=”prod @2 1 2″/>
<v:f eqn=”prod @3 21600 pixelWidth”/>
<v:f eqn=”prod @3 21600 pixelHeight”/>
<v:f eqn=”sum @0 0 1″/>
<v:f eqn=”prod @6 1 2″/>
<v:f eqn=”prod @7 21600 pixelWidth”/>
<v:f eqn=”sum @8 21600 0″/>
<v:f eqn=”prod @7 21600 pixelHeight”/>
<v:f eqn=”sum @10 21600 0″/>
</v:formulas><v:path o:extrusionok=”f” gradientshapeok=”t” o:connecttype=”rect”/>
<o:lock v:ext=”edit” aspectratio=”t”/>
</v:shapetype><v:shape id=”_x0000_s1606″ type=”#_x0000_t75″ style=’position:absolute;left:57pt;top:519pt;width:413pt;height:22pt’>
<v:fill on=”f”/>
<v:stroke on=”f”/>
<v:imagedata o:relid=”rId1″ o:title=”” grayscale=”f” bilevel=”f”/>
<o:lock v:ext=”edit” aspectratio=”t” position=”f” selection=”f” grouping=”f”/>
</v:shape><v:shape id=”_x0000_s1607″ type=”#_x0000_t75″ style=’position:absolute;left:409pt;top:455pt;width:174pt;height:65pt’>
<v:fill on=”f”/>
<v:stroke on=”f”/>
<v:imagedata o:relid=”rId2″ o:title=”” grayscale=”f” bilevel=”f”/>
<o:lock v:ext=”edit” aspectratio=”t” position=”f” selection=”f” grouping=”f”/>
</v:shape><v:shape id=”_x0000_s1608″ type=”#_x0000_t75″ style=’position:absolute;left:568pt;top:22pt;width:165pt;height:81pt’>
<v:fill on=”f”/>
<v:stroke on=”f”/>
<v:imagedata o:relid=”rId3″ o:title=”” grayscale=”f” bilevel=”f”/>
<o:lock v:ext=”edit” aspectratio=”t” position=”f” selection=”f” grouping=”f”/>
</v:shape><v:shape id=”_x0000_s1609″ type=”#_x0000_t75″ style=’position:absolute;left:661pt;top:266pt;width:115pt;height:258pt’>
<v:fill on=”f”/>
<v:stroke on=”f”/>
<v:imagedata o:relid=”rId4″ o:title=”” grayscale=”f” bilevel=”f”/>
<o:lock v:ext=”edit” aspectratio=”t” position=”f” selection=”f” grouping=”f”/>
</v:shape><v:shapetype id=”_x0000_t201″ coordsize=”21600,21600″ o:spt=”201″
path=”m,l,21600r21600,l21600,xe”>
<v:stroke joinstyle=”miter”/>
<v:path shadowok=”f” o:extrusionok=”f” strokeok=”f” fillok=”f”
o:connecttype=”rect”/>
<o:lock v:ext=”edit” shapetype=”t”/>
</v:shapetype><v:shape id=”CommandButton1″ o:spid=”_x0000_s1610″
type=”#_x0000_t201″ style=’position:absolute;left:277pt;top:424pt;width:51pt;height:48pt’>
<v:fill on=”f”/>
<v:stroke weight=”.75pt” miterlimit=”8″ joinstyle=”miter” on=”f”/>
<![if gte mso 9]><v:imagedata o:relid=”rId5″ o:title=”” croptop=”0″
cropbottom=”0″ cropleft=”0″ cropright=”0″ grayscale=”f” bilevel=”f”/>
<![endif]><v:shadow on=”f” type=”single” color=”#cedbe6 [2]” opacity=”1″
obscured=”f” origin=”0,0″ offset=”2pt,2pt” matrix=”1,0,0,1″/>
<o:lock v:ext=”edit” aspectratio=”f” position=”f” selection=”f” grouping=”f”/>
</v:shape></xml>May 13, 2016 at 10:08 am #3394Hi,
VML is strange – it looks like XML, but it is not.
There is, I recall, a way to ‘hack’ the VML so that it can be read by an XML parser, but I don’t recall the details.
Right now, I am fully engaged in completing a module that enables comparing two DOCX files and producing another file that contains tracked revisions, and contractually need to finish this ASAP, so can’t spend any time researching this. However, I do recall doing this at one point.
Question – why are you using a presentation that contains VML? It is deprecated. If you load the presentation in PowerPoint, and then specify the right option, then I believe that you can save the presentation in such a way that it replaces VML with DrawingML.
-Eric
May 13, 2016 at 6:17 pm #3401Hi Eric,
Thanks for the response. Basically as I mentioned in my earlier posts, we are using PresentationBuilder to extract objects out of it. We load the document and extract these object. I just got an document for which I am able to open in PowerPoint but when I ran through the PresentationBuilder it fails for that vml object. It will be great if you can let me know how I can either convert the vml into drawingxml(programmatically) or by any how hack the vml thing.
Thanks,
Prince -
AuthorPosts
You must be logged in to reply to this topic.